-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Draft: OPUpdatePrestate #13998
base: develop
Are you sure you want to change the base?
Draft: OPUpdatePrestate #13998
Conversation
packages/contracts-bedrock/scripts/deploy/updater-deployment-out.md
Outdated
Show resolved
Hide resolved
a81ef76
to
62a8fe6
Compare
65ffef4
to
3565fbb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is looking pretty good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file LGTM
); | ||
} | ||
|
||
function test_updatePrestate_succeeds() public { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even if they aren't written yet, it will speed up the process if you could add empty test functions for other cases that we'll add here.
Ie. just:
function test_updatePrestate_emptyPrestate_fails(){}
that way we can make sure we're on the same page about what tests are needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added my tests, let's talk about the ones that you think are missing on the meeting. Probably testing that 2 inputs work and get correctly reordered if we have fdg and pdg
bool hasFDG = Claim.unwrap(_prestateUpdateInputs[i].absolutePrestate) != bytes32(0); | ||
AddGameInput[] memory inputs = new AddGameInput[](hasFDG ? 2 : 1); | ||
AddGameInput memory pdgInput; | ||
AddGameInput memory fdgInput; | ||
|
||
if (Claim.unwrap(_prestateUpdateInputs[i].absolutePrestate) == bytes32(0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can we use Claim.unwrap(_prestateUpdateInputs[i].absolutePrestate) != bytes32(0)
to determine if there is a FDG when we also revert if Claim.unwrap(_prestateUpdateInputs[i].absolutePrestate) == bytes32(0)
?
I'd have expected we determine if there's a FDG by seeing if DisputeGameFactory.gameImpls(GameTypes.CANNON) != address(0)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, that check looks wrong. Should be similar to here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see. This line dates to when we were accepting an absolutePrestate for each game, and so providing one for the fdg was just taken as an indication that it exists.
Accepting a single absolutePrestate
, then querying to see if there is an FDG is a better approach.
9a145b8
to
b326e30
Compare
No description provided.