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

use warpRequirePrimaryNetworkSigners config #537

Merged
merged 8 commits into from
Nov 22, 2024
Merged

Conversation

iansuvak
Copy link
Contributor

@iansuvak iansuvak commented Oct 31, 2024

Why this should be merged

Fixes #454

How this works

Fetches the additional value from the config and uses it when creating application relayer struct.

Open q: WarpQuorum struct doesn't seem very useful since denominator is hardcoded at compile time to 100

How this was tested

  • Existing tests should pass
  • New unit test cases added
  • E2E tests will be added soon in a separate PR

How is this documented

@iansuvak iansuvak force-pushed the self-signing-config branch from d5ee2ba to 45889ae Compare November 19, 2024 15:22
@iansuvak iansuvak marked this pull request as ready for review November 21, 2024 21:29
@iansuvak iansuvak requested a review from a team as a code owner November 21, 2024 21:29
Comment on lines 92 to 93
// this shouldn't be reachable since if we found a quorum, we should also find the requirePrimaryNetworkSigners
// but leaving the check for completeness
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's probably an indication we should be able to fetch them from the config together?

I also agree with your comment that the current WarpQuorum object is unnecessary. We can just use a uint for QuorumPercentage, or have WarpQuorum contain the percentage and requirePrimaryNetworkSigners

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went with the latter route and renamed it to WarpConfig. It's basically identical to the source WarpConfig defined in subnet-evm but doesn't implement the Upgrade interface and when converting it we populate it with warpDefaultQuorumNumerator value if it's 0

relayer/application_relayer.go Outdated Show resolved Hide resolved
relayer/config/config.go Outdated Show resolved Hide resolved
return s.warpRequirePrimaryNetworkSigners, nil
}
}
return false, errFailedToGetWarpQuorum
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this error should say anything about the Warp Quorum. We error here iff the destination blockchain is in the config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the wording to indicate that the blockchainID is not in the destination blockchains. Thanks!

relayer/config/config.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@cam-schultz cam-schultz left a comment

Choose a reason for hiding this comment

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

LGTM, once @geoff-vball 's comments are addressed

relayer/config/config.go Outdated Show resolved Hide resolved
Copy link
Contributor

@geoff-vball geoff-vball left a comment

Choose a reason for hiding this comment

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

🚀

@iansuvak iansuvak merged commit 7021dec into main Nov 22, 2024
8 checks passed
@iansuvak iansuvak deleted the self-signing-config branch November 22, 2024 19:52
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.

Add config switch for primary network validator signature verification optimization
3 participants