The protocol is constructed in such a way that at least 2/3 of validators will always be online. The average uptime across all validators in the network. Rewards are not issued until the network reaches genesis (524,288 ETH staked). The higher the percentage, the lower the yield. The total ETH staked (as a percentage of circulating supply) plays a significant role in calculating the annual interest earned on a validator’s stake. This variable defaults to the current price but can be set manually under advanced settings. The price of ETH is used to provide a rough measure of the return on investment in fiat currency terms. For those without the minimum 32 ETH requirement, third party services are being developed to allow for greater flexibility in the amount staked. For the purposes of this calculator for the benefit of simplicity, any amount of ETH can be used in the calculation. Those wishing to stake more than 32 ETH can run multiple validators. As per the Phase 0 specification, each staking node (validator) can only stake 32 ETH. This is the amount of ETH staked (invested) in the Ethereum 2.0 deposit contract. Users can select “Advanced Settings” to modify a number of variables that impact a validator’s expected return on investment. Take the rlp output and apply a keccak256 hash on it.The calculator on this page aims to simplify the front-end complexities of gauging an expected return when staking in the upcoming Ethereum 2 deposit contract. Pass this array into a rlp.encode function. Restructure the object to form an array of strings. Convert numbers to Hex and handle values with 0s. Remove unwanted elements and keep only those that are inputs to a blockHeader. Pass the above RLP through a keccak256 function. The above array of values can now be fed into a rlp.encode function After changing the numbers to Hex and handing values with 0, we can go ahead and remove all the keys listed in Step2 and restructure the array as below: So the value used for gasUsed should be 0x and not 0x0 For elements with value as 0, use 0x and not 0x0Įxample: for block 400000, the value for gasUsed is 0. Convert values with numbers to Hex console.log((gasLimit)) Ĭonsole.log((difficulty)) Remove some of the elements from the above object, keep only those that are inputs into a blockHeader, and reorder it as below: This is the actual output which will be used later to compare the test results with. Hash in the above object refers to the blockHash which we are trying to validate. Below are the steps to calculate blockHash, given a blockNumber:
0 Comments
Leave a Reply. |