Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Query validator set #97

Merged
merged 12 commits into from
Jun 29, 2023
Merged

Query validator set #97

merged 12 commits into from
Jun 29, 2023

Conversation

cryptoAtwill
Copy link
Collaborator

@cryptoAtwill cryptoAtwill commented Jun 20, 2023

List the details of validators and support configuration number.

adlrocha
adlrocha previously approved these changes Jun 20, 2023
Copy link
Contributor

@adlrocha adlrocha left a comment

Choose a reason for hiding this comment

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

LGTM. Let's maybe call it ValidatorInfo instead of ValidatorDetails if you don't mind.

src/SubnetActor.sol Outdated Show resolved Hide resolved
@@ -305,7 +311,7 @@ contract SubnetActor is ISubnetActor, ReentrancyGuard, Voting {

/// @notice get all the validators in the subnet.
/// TODO: we can introduce pagination
function getValidators() external view returns (address[] memory) {
function getValidators() public view returns (address[] memory) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why changing external to public?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's called in the getValidatorsInfo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed back to external

@cryptoAtwill cryptoAtwill changed the title Full validators Query validator set Jun 20, 2023
Copy link
Contributor

@adlrocha adlrocha left a comment

Choose a reason for hiding this comment

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

We should increase the config number also when the stake of a validator that is already part of the subnet changes. And the sequence number only increases, even when a validator leaves.

src/SubnetActor.sol Outdated Show resolved Hide resolved
@@ -50,6 +50,9 @@ contract SubnetActor is ISubnetActor, ReentrancyGuard, Voting {
/// @notice Minimal number of validators required for the subnet to be able to validate new blocks.
uint64 public immutable minValidators;

/// @notice Sequence number that uniquely identifies a validator set.
uint64 public configurationNumber;
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be cleaner to include the configuration number in a struct aggregating all validator information, but I guess for now this is good enough.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I created that struct, we can migrate to use that struct later

src/SubnetActor.sol Outdated Show resolved Hide resolved
adlrocha
adlrocha previously approved these changes Jun 20, 2023
Copy link
Contributor

@adlrocha adlrocha left a comment

Choose a reason for hiding this comment

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

LGTM now!

cryptoAtwill and others added 3 commits June 20, 2023 18:48
* support f1 address

* Fix reentrancy vulnerabilities (#115)

Fix reentrancies

* Change intro (#118)

* Minor gas optimisations (#112)

minor gas optimisations

* Use logical if statements (#113)

use logical if statements

* Make gateway address immutable (#110)

Make gateway addr immutable

* Enable basic linting (#116)

* Enable basic linting

* add config for mythrill

* Run tests on Github Actions (#119)

* Run tests

* add info

* triage findings

* rename private vars

* fix if statements

* Fix reentrancy (#114)

* fix reentrancy

* Update src/Gateway.sol

* add a comment

* fix format

---------

Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com>

* Check gateway address (#109)

* check gateway address

* check subnet address

* check actor address

* Optimise loop (#123)

* Optimise loop

* Fix several if stmts

* Rename params to fix slither issues

* Add codespell (#122)

* Remove unused constants and fix Makefile (#121)

* remove unused fvm-related constants

* fix makefile

* Fix bottom-up nonce and new test (#124)

fix bottomup nonce and new tets

* Use the same Solidity version (#111)

use the same Solidity version

* Update contract dependencies (#117)

* Update contract dependencies

* upgrade solidity to 0.8.19

---------

Signed-off-by: Alfonso de la Rocha <adlrocha@tutamail.com>
Co-authored-by: Alfonso de la Rocha <adlrocha@tutamail.com>

* linter for address

* Improved subnet registry (#127)

* improved subnet registry

* Update SubnetRegistry.sol

* Migrate bottom up checkpoints query to subnet actor (#130)

migrate bottom up checkpoints query to subnet actor

---------

Co-authored-by: Denis Kolegov <dnkolegov@gmail.com>
Co-authored-by: cryptoAtwill <108330426+cryptoAtwill@users.noreply.github.com>

---------

Signed-off-by: Alfonso de la Rocha <adlrocha@tutamail.com>
Co-authored-by: Denis Kolegov <dnkolegov@gmail.com>
Co-authored-by: adlrocha <6717133+adlrocha@users.noreply.github.com>
Co-authored-by: Alfonso de la Rocha <adlrocha@tutamail.com>
Signed-off-by: Alfonso de la Rocha <adlrocha@tutamail.com>
@adlrocha adlrocha merged commit 3ad8b23 into main Jun 29, 2023
@dnkolegov dnkolegov deleted the full_validators branch July 28, 2023 13:29
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.

2 participants