ava-labs / teleporter

EVM cross-chain messaging protocol built on top of Avalanche Warp Messaging
Other
49 stars 24 forks source link

Add a method to the Validator Manager so as to obtain the list of all the validators in the subnet #594

Open felipemadero opened 1 month ago

felipemadero commented 1 month ago

Context and scope There is no way to obtain such a list from the contract itself.

Discussion and alternatives Include a description of the changes to be made to the code along with alternatives that were considered, including pro/con analysis where relevant.

Open questions Questions that are still being discussed.

cam-schultz commented 1 month ago

Is there any reason why GetValidatorsAt can't be used instead? This is what we use in our E2E tests to construct Warp signatures.

Exposing this in the contract would require us to maintain additional state in the contract, since there's no way to extract all set keys from a mapping in Solidity.

felipemadero commented 1 month ago

Is there any reason why GetValidatorsAt can't be used instead? This is what we use in our E2E tests to construct Warp signatures.

Exposing this in the contract would require us to maintain additional state in the contract, since there's no way to extract all set keys from a mapping in Solidity.

I see. I thought that was an option in Solidity. I believe the contract will be much more self contained providing this ofc important information. We at CLI can manage to use P-Chain.