OpenZeppelin / OpenZeppelin/openzeppelin-upgrades

Validate external linked libraries

Open
#52 9 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
658
Forks
286
PR merge metrics
No merged PRs in 30d

Description

At the moment of deployProxy, we have to validate that the linked libraries are using code that has been validated to be upgrade safe. In the solc output for a contract we find the locations in the bytecode where the addresses of linked libraries will be found. During deployProxy we have to extract those addresses, fetch the bytecode at that address, and look it up in the validations object.

We may have issues with fetching the bytecode if the library deployment hasn't been mined yet. I think this is a real concern that we should think about a little bit before proceeding. This is what I meant in the first paragraph. It's different from https://github.com/OpenZeppelin/openzeppelin-upgrades/issues/22 because we deploy those impls ourselves, but in my proposed workflow for libraries, it's the user who deploys those libraries so we don't have the information about the library deployment (e.g. "version", txid, etc.) unless we can somehow retrieve the bytecode from the address.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the deployProxy flow and review how solc linked-library locations and the validations object are currently represented. Determine how to extract library addresses, retrieve deployed bytecode, and handle deployments that have not been mined; the work is done when linked libraries can be validated reliably before deployment.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity, typescript
Domain
blockchain, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.