This repository was archived by the owner on Jan 27, 2026. It is now read-only.
load validator addresses from contract#181
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates how validator addresses are obtained by loading them directly from the on-chain contract, instead of using a hardcoded or command-line provided address. Key changes include:
- Removing the validator_address argument from CLI options in both worker and discovery components.
- Introducing a new asynchronous method get_validator_role in the PrimeNetworkContract that retrieves the validator addresses.
- Updating API server initialization in both worker and discovery components to build the allowed addresses list using the on-chain validator role.
Reviewed Changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| worker/src/cli/command.rs | Removed the unused validator_address argument. |
| worker/src/api/server.rs | Replaced validator_address usage with on-chain validator role retrieval. |
| shared/src/web3/contracts/implementations/prime_network_contract.rs | Added get_validator_role function to fetch validator addresses and accompanying tests. |
| discovery/src/main.rs | Removed the CLI argument for validator_address. |
| discovery/src/api/server.rs | Updated the validator initialization to use on-chain addresses. |
Files not reviewed (2)
- Makefile: Language not supported
- discovery/Dockerfile: Language not supported
Comments suppressed due to low confidence (1)
discovery/src/api/server.rs:48
- [nitpick] The variable name 'validator_validator' is ambiguous. Consider renaming it to 'validator_state' for clarity.
let validator_validator = Arc::new(ValidatorState::new(validators));
…ct.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
mattdf
approved these changes
Mar 28, 2025
JannikSt
added a commit
that referenced
this pull request
Apr 12, 2025
* load validator addresses from contract * ignore blockchain test * Update shared/src/web3/contracts/implementations/prime_network_contract.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * adjust compose --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
fixes #122