Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split BytecodeStorage into public/internal libraries #684

Merged
merged 25 commits into from
May 5, 2023

Conversation

jakerockland
Copy link
Contributor

@jakerockland jakerockland commented May 3, 2023

Description of the change

This PR builds on top of #668 and #670 to actualize the architecture discussed in #422 (comment) of a split public shared external reader library and an internal writer library.

This PR is intended to be atomically merged into main at the same time as #668 and #670 and is thus marked as "do not merge" until all three have been through review and are ready to merge. Because of this, we are not bumping the versions of the client CoreV3 contracts using this library with this changeset, as they are already version-bumped in #668.

Note: that this PR is still marked as a WIP as we have not yet made the necessary changes to the deployment script of this PR, as that will be a "phase 2" update to this changeset after I have gotten an initial LGTM from reviewers on the overall architecture and code structure here.

Our shared deployer script has been added, and deployment using this library linking approach has been validated end-to-end on goerli, with shared deployments of the library being deployed on both goerli and mainnet.

Pending the final approval of this PR, I will merge this as well as #668 and #670 into main, and we can consider the V1 version of this new BytecodeStorage library as released!! (closes #660).

@jakerockland jakerockland changed the base branch from main to twoVersionnnnnzz May 3, 2023 16:23
@jakerockland jakerockland added the do not merge Not auto-merge-able label May 3, 2023
@jakerockland jakerockland changed the title WIP - split BytecodeStorage into public/internal libraries WIP - Split BytecodeStorage into public/internal libraries May 4, 2023
@jakerockland jakerockland marked this pull request as ready for review May 4, 2023 00:33
@jakerockland jakerockland requested a review from a team as a code owner May 4, 2023 00:33
@jakerockland jakerockland requested review from ryley-o and yoshiwarab and removed request for a team May 4, 2023 00:33
Copy link
Contributor

@ryley-o ryley-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - really like this architecture 🙏

a few comments with some minor nits is all 🥳

@jakerockland jakerockland changed the title WIP - Split BytecodeStorage into public/internal libraries Split BytecodeStorage into public/internal libraries May 4, 2023
Copy link
Contributor

@ryley-o ryley-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 very awesome!

@jakerockland jakerockland removed the do not merge Not auto-merge-able label May 5, 2023
@jakerockland jakerockland merged commit 3122452 into twoVersionnnnnzz May 5, 2023
@jakerockland jakerockland deleted the splitLib branch May 5, 2023 14:12
jakerockland added a commit that referenced this pull request May 5, 2023
* Support basic semantic versioning – and ensure interop with backwards compatible reads (tests added)

* update the version string

* minor adjustment and a song: https://www.youtube.com/watch\?v\=vOreqez4v9Y

* Update to reflect better v1/v0/unknown versioning semantics

* Update documentation and code structuring

* Refactor size == 0 check

* clean up offset checks

* `STORE2`-compatible reads in `BytecodeStorage` (#681)

* Update BytecodeStorage library to provide backwards-compatible reads that are compatible with SSTORE2 as the fallback read option, in advance of plans to split off reads into a shared external public utility library, in-companion to the embedded internal library for writes.

* Whoops, forgot to add all the files yo

* add support for manual-offset reads

* SSTORE2 / explicit bytes reads restructure

* Comment fix

* Filename fix

* Filename fix

* Better typing for tests

* spelling fixes

* Split `BytecodeStorage` into public/internal libraries (#684)

* basic MVP of split library (with tests)

* Adjusted tests for split library setup

* minor modifier adjustment

* Adjust optimizer runs

* optimizer order

* nit

* get interface from deployed contract

* get interface from deployed contract

* ensure libraries are linked

* library linkkinnnn

* More linking fixes in tests

* update Engine Flex as PoC (#688)

* fix the rest of the test bindingsgit diff

* OPTIMIZOOOOOR

* remove unnecessary using for

* Fixed comment

* public constants

* Update library naming convention

* DEPLOYOOOOOR

* DEPLOYOOOOOR

* format

* Address nits

---------

Co-authored-by: ryley-o <30364988+ryley-o@users.noreply.github.com>

---------

Co-authored-by: ryley-o <30364988+ryley-o@users.noreply.github.com>
jakerockland added a commit that referenced this pull request May 5, 2023
* Remove all call-sites for purgeBytecode, before cleaning up library internals

* Remove purge logic from library entirely

* fix comment

* Update to reflect TWO VERSIONS (https://www.youtube.com/watch\?v\=diIFhc_Kzng)

* Update to reflect TWO VERSIONS (https://www.youtube.com/watch\?v\=diIFhc_Kzng)

* Update contracts/libs/0.8.x/BytecodeStorageV1.sol

Co-authored-by: ryley-o <30364988+ryley-o@users.noreply.github.com>

* Update contracts/libs/0.8.x/BytecodeStorageV1.sol

Co-authored-by: ryley-o <30364988+ryley-o@users.noreply.github.com>

* Update contracts/libs/0.8.x/BytecodeStorageV1.sol

Co-authored-by: ryley-o <30364988+ryley-o@users.noreply.github.com>

* Add basic form of `BytecodeStorage` library versioning (#670)

* Support basic semantic versioning – and ensure interop with backwards compatible reads (tests added)

* update the version string

* minor adjustment and a song: https://www.youtube.com/watch\?v\=vOreqez4v9Y

* Update to reflect better v1/v0/unknown versioning semantics

* Update documentation and code structuring

* Refactor size == 0 check

* clean up offset checks

* `STORE2`-compatible reads in `BytecodeStorage` (#681)

* Update BytecodeStorage library to provide backwards-compatible reads that are compatible with SSTORE2 as the fallback read option, in advance of plans to split off reads into a shared external public utility library, in-companion to the embedded internal library for writes.

* Whoops, forgot to add all the files yo

* add support for manual-offset reads

* SSTORE2 / explicit bytes reads restructure

* Comment fix

* Filename fix

* Filename fix

* Better typing for tests

* spelling fixes

* Split `BytecodeStorage` into public/internal libraries (#684)

* basic MVP of split library (with tests)

* Adjusted tests for split library setup

* minor modifier adjustment

* Adjust optimizer runs

* optimizer order

* nit

* get interface from deployed contract

* get interface from deployed contract

* ensure libraries are linked

* library linkkinnnn

* More linking fixes in tests

* update Engine Flex as PoC (#688)

* fix the rest of the test bindingsgit diff

* OPTIMIZOOOOOR

* remove unnecessary using for

* Fixed comment

* public constants

* Update library naming convention

* DEPLOYOOOOOR

* DEPLOYOOOOOR

* format

* Address nits

---------

Co-authored-by: ryley-o <30364988+ryley-o@users.noreply.github.com>

---------

Co-authored-by: ryley-o <30364988+ryley-o@users.noreply.github.com>

---------

Co-authored-by: ryley-o <30364988+ryley-o@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants