Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

opnode: Update and deploy contracts #360

Merged
merged 1 commit into from
Apr 11, 2022
Merged

opnode: Update and deploy contracts #360

merged 1 commit into from
Apr 11, 2022

Conversation

trianglesphere
Copy link
Contributor

@trianglesphere trianglesphere commented Apr 8, 2022

This is rather than hardcoding the contract bytecode. It slows down the e2e
tests (by having to wait 1 L1 block for contracts to be ready), but it
is more accurate to what occurs (and is now required as we initialize
actions).

It also uses the new contracts. No CI for them yet.

@trianglesphere trianglesphere force-pushed the jg/contracts branch 4 times, most recently from e7a27e6 to fcfd8b8 Compare April 11, 2022 21:13
@trianglesphere trianglesphere changed the title opnode: Update contracts opnode: Update and deploy contracts Apr 11, 2022
@trianglesphere trianglesphere marked this pull request as ready for review April 11, 2022 21:19
opnode/test/setup.go Outdated Show resolved Hide resolved
opnode/test/setup.go Show resolved Hide resolved
opnode/test/setup.go Show resolved Hide resolved
opnode/test/system_test.go Show resolved Hide resolved
@mslipper
Copy link
Collaborator

I'd give this a rebase off latest main - there are contract changes that aren't reflected here.

@trianglesphere
Copy link
Contributor Author

trianglesphere commented Apr 11, 2022

I'd give this a rebase off latest main - there are contract changes that aren't reflected here.

Will try again, but I'm pretty sure that this is at least from this week.

EDIT: The L2Output submitter contracts were not updated.

--type l1block \
--out ./l1block/l1_block_info_raw.go
cat $(temp)/combined.json | jq -r ".contracts | with_entries(select(.key | match(\"L1Block\")))[] | .\"bin-runtime\"" > bin/l1block_deployed.hex

Copy link
Contributor

Choose a reason for hiding this comment

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

There is currently nothing enforcing the version of solc being used which could result in non-determinism between different machines

Copy link
Contributor

Choose a reason for hiding this comment

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

This is what foundry uses to manage versioning: https://github.com/roynalnaruto/svm-rs

Is there anyway that we can get the combined json from forge build? That would abstract away the solc version management

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't we have pragmas on the contracts? I had to switch versions of solc this morning to get this to work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we previously did do something where we would use the artifacts from hardhat. My big worry with that is if it doesn't get rebuilt prior to running this so I prefer building from source here.

Copy link
Contributor

Choose a reason for hiding this comment

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

The pragmas must be exact matches for this to be safe, it looks like they generally are except for the output oracle:

Copy link
Contributor

Choose a reason for hiding this comment

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

There is also a --solc flag for abigen that lets you pass a path to solc and it'll compile + build the bindings. Perhaps we allow for a configurable solc path with just using solc as a default, this way anybody can build and we aren't opinionated about how the user manages the version of solc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I'll switch this just 0.8.10 and create an issue to look into this later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Longer term the solution should be something like forge bind go where foundry manages the bindings being up to date

cat $(temp)/combined.json | jq -r ".contracts | with_entries(select(.key | match(\"L1Block\")))[] | .\"bin-runtime\"" > bin/l1block_deployed.hex


bindings-optimism-oracle:
Copy link
Contributor

Choose a reason for hiding this comment

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

This name makes it sound like its meant to build the output oracle but it builds the portal

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

This is rather than hardcoding the contract value. It slows down the e2e
tests (by having to wait 1 L1 block for contracts to be ready), but it
is more accurate to what occurs (and is now required as we initialize
actions).
@trianglesphere trianglesphere merged commit 05136a3 into main Apr 11, 2022
@trianglesphere trianglesphere deleted the jg/contracts branch April 11, 2022 22:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants