Conversation
Contributor
Author
|
See also: #2935 |
CHr15F0x
reviewed
Sep 19, 2025
CHr15F0x
reviewed
Sep 19, 2025
CHr15F0x
reviewed
Sep 19, 2025
bd226d4 to
67ddfea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR replaces the static
ValidatorSetused in consensus with a dynamic validator fetching system that can retrieve validators from an L2 contract at runtime. This enables the consensus system to work with validator sets that change over time based on on-chain state.New
L2ValidatorSetProviderimplements theValidatorSetProvidertrait to fetch validators dynamically.To keep things working with our current setup, it supports two modes:
validator_addressesis provided in config, it will use those addresses with random keys.validator_fetcher::get_validators_at_height()The validator fetching logic is temporarily in a new crate
validator-fetcher. This was done because I've also added an RPC method for us to conveniently test this whenever the spec is finalized. As mentioned in the TODO comments, thevalidator-fetchercrate and its RPC method will be removed once the final specification is available, and the functionality will be migrated directly into the consensus module of the pathfinder crate.As a side note, I also updated our
pathfinder_consensus::ValidatorSetProvidertrait to allow for errors.Here is the Cairo test contract I'm using in case you're curious, which btw is deployed here.