-
Notifications
You must be signed in to change notification settings - Fork 232
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
warp: add "requirePrimaryNetworkSigners" precompile config #1232
Conversation
…uirePrimaryNetworkSigners
…bs/subnet-evm into warp-requirePrimaryNetworkSigners
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
…bs/subnet-evm into warp-requirePrimaryNetworkSigners
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.
overall LGTM, just a nit to convert the function to an interface
I think the intention of this block is an explanation of what tests are being performed. I see that you made changes to the unit tests but I don't have the context to understand why they are sufficient to prove that this works. |
…uirePrimaryNetworkSigners
This reverts commit 74d4c70.
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.
LGTM. Thanks for the changes.
Caveat: I don't know enough about the specific test cases in the table nor the implication of mySubnetID
in validators.NewState()
to comment on them, but I think it's all now clear enough that I'm deferring to Cey's existing Approval.
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.
Makes sense to me 🙏
Why this should be merged
#1230
How this works
Adds a precompile config option where "requirePrimaryNetworkSigners" can be added at warp activation (or de-activated and then re-activated with this flag by existing networks).
Note we can't use a "per node" config, since when the optimization is applied the validator bitset is modified.
Basically the existing rules do not allow for the primary network's validators to sign for themselves but expects only the subnet validator set. Since the entire validator set is replaced, this includes expectations for the bitset, etc.
How this was tested
CI:
Expands UT for TestWarpMessageFromPrimaryNetwork (in precompile/contracts/warp/predicate_test.go) to include both cases for requirePrimaryNetworkSigners,
Modifies (expands) TestReceiveWarpMessage:
I also added a check the result of the predicate in the block since the previous test asserts behavior about whether the block is valid or not in a different height context, but the block would be considered valid (but failed warp message), then the assertion that does a trace comes later.
It seemed preferable to verify the predicate results are as expected instead of re-ordering the existing code.
How is this documented
Not yet