Replies: 2 comments 7 replies
-
Nice writeup and interesting idea. I actually have no idea what the answer is, but just some reactions and thoughts.
I know many of these questions have been typed about elsewhere, but these are the types of things that started swirling around in my mind when reading. |
Beta Was this translation helpful? Give feedback.
-
I'm curious why you came up with the idea of doing the "timestamp modulo" logic at the contract level instead of the SDK. My approach to selection would be to let the contract return all the validators and let the SDK manage that (being the modulo idea, or other since a validator with less stake maybe is less trusted than others with higher stake?). The SDK can also cache the result for some period to avoid on-chain calls (even if they're read, they can have a cost). |
Beta Was this translation helpful? Give feedback.
-
This is a proposal is in response to tension #240. I'm posting as a means to get ideas flowing, and it would be great if other folks want to create alternatives or add to this.
I'll propose that for each Tableland Network there will be a smart contract that has a
mapping
that maps a uint256 to a struct that contains an RFC 3986 DNS address and a wallet address. Every entry of this mapping contains the DNS address a Validator can be reached at and the public key of the wallet they are using to interact with the Registry contract (and maybe how much wei they have staked?).pseudocode:
This mapping will be readable via a few different public functions, and writable with a protected function who's protections can match whatever the criteria for being a registered Validator are, e.g. Staking some kind of token or coin, asking to be part of our early external Validator program, etc... We may also want a means to ensure that only one entry per wallet and/or host is allowed.
When a client wants to connect to Tableland but doesn't already have a specific Validator in mind, they can use their EVM chain provider to call one of the public read functions with a timestamp (maybe least significant 10^7 digits of ms since epoch?). The read function can do a modulo with number of Validators to pick which Validator info the client should use and send that info to the client. This accomplishes a simple sort of load balancing that doesn't give any kind of preference to any specific Validators (Is this true?).
pseudocode:
There's some trickiness in implementation here because we need to track how many Validators we have, and we need to enable removing Validators that no longer should/want to participate. This removal could be something Validators do themselves, or in the near term while the core team manages external validators we could explicitly do it. In medium/long term if some kind of staking is included, the Validator's stake going to zero might trigger a removal. All that is TBD, just mentioning as food for thought.
Pushing aside a few implementation details, now clients have a way to get the info they need to connect to a Validator without putting preference on any specific one. There's another potential use this might solve. evm-tableland issue 33 describes enabling approving accounts to act on behalf of others. This could be as simple as if an address is approved, then let it act. However we could build in more protections against malicious addresses if mechanism to check the approved address includes enforcement that the address is a Validator in good standing.
Notes:
Beta Was this translation helpful? Give feedback.
All reactions