Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

load validator addresses from contract#181

Merged
JannikSt merged 4 commits into
developfrom
improvement/validator-address-loading
Mar 28, 2025
Merged

load validator addresses from contract#181
JannikSt merged 4 commits into
developfrom
improvement/validator-address-loading

Conversation

@JannikSt
Copy link
Copy Markdown
Member

@JannikSt JannikSt commented Mar 28, 2025

fixes #122

@JannikSt JannikSt requested a review from Copilot March 28, 2025 00:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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));

Comment thread shared/src/web3/contracts/implementations/prime_network_contract.rs Outdated
JannikSt and others added 2 commits March 27, 2025 17:08
…ct.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@JannikSt JannikSt requested a review from mattdf March 28, 2025 00:11
@JannikSt JannikSt merged commit 083adc4 into develop 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>
@JannikSt JannikSt deleted the improvement/validator-address-loading branch June 25, 2025 13:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Load validator address list from the chain instead of feeding in as argument

3 participants