Comments (7)
Sorry accidentally fat fingered as a commit instead of a PR, but here's a simple solution: fe74c7e
from consensus-specs.
Sgtm!
from consensus-specs.
Proposed implementation --
- move
randao_mix
toCrystallizedState
- store array of size
CYCLE_LENGTH
inactive_state
. These values are each initialized to0x00 * 32
. Call itpending_randao_reveals
- when processing a block, check the validity of the reveal.
- during state recalc, for each slot in
(last_state_recalc, last_state_recalc + CYCLE_LENGTH - 1)
- if
active_state.pending_randao_reveals[slot] != 0x00 *32
- let
proposer_index
be the proposer index from the shuffling related to the slot - `crystallized_state.randao_mix = xor(crystallized_state.randao_mix, active_state.pending_randao_reveals[slot])
crystallized_state.validators[proposer_index].randao_commitment = active_state.pending_randao_reveals[slot]
- let
- if
- after a state recalc, set
active_state.pending_randao_reveals
to be CYCLE_LENGTH 0x00 hashes - after doing all state recalcs, set
active_state.pending_randao_reveals[block.slot % CYCLE_LENGTH] = block.randao_reveal
Note that setting the pending_randao_reveals
for the current block happens after state recalcs. This is to handle the case when a block is at (or after) the slot that triggers a state recalc. If we want too keep the size of pending_randao_reveals
fix, then we have to do this trick.
There is an alternative method that would do appends and truncates like recent_block_hashes
where we fill in missing slots with 0x00
whenever slots are skipped. Need to consider which I prefer..
from consensus-specs.
cc: @JustinDrake
from consensus-specs.
Do we need randao_mix
? or can we just use dynasty_seed
?
Also during dynasty transition, we should do the following:
crystallized_state.dynasty_seed = crystallized_state.randao_mix
shard_and_committee_for_slots[CYCLE_LENGTH:] = get_new_shuffling(crystallized_state.randao_mix, validators, next_start_shard)
from consensus-specs.
I'd say use the term randao_mix
instead of dynasty_seed
. #61 removes all references of the word "dynasty" entirely.
from consensus-specs.
@terenc3t @vbuterin is it okay to close this issue by fe74c7e?
from consensus-specs.
Related Issues (20)
- How is `MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS` guaranteed? HOT 1
- Remove phase0-capella state transition tests from the test vector output HOT 2
- Clarify `voluntary_exits` gossip topic after Capella HOT 3
- KYC blockchain updat
- EIP-7594: PeerDAS open questions HOT 8
- EIP-7251: effective balance check for pending withdrawals is too strict HOT 2
- Remove post-altair `initialize_beacon_state_from_eth1` from specs HOT 2
- Electra open questions HOT 2
- EIP-7251 open questions / tasks
- EIP-7251: update exit churn logic
- Rework phase0 aggregate step
- EIP-7594 (PeerDAS): interop preparation tests
- Consider refactoring `upgrade_to_electra`
- Electra: missing re-definition of `get_indexed_attestation`
- wrong consolidation operations test vector output
- `get_merkle_proof` returning too many values
- Consolidation operation reference tests on mainnet invalid for the wrong reasons HOT 1
- EIP-7594 - Shorten the new introduced ENR record key (`custody_subnet_count`). HOT 7
- Consider migrating `MIN_ACTIVATION_BALANCE` and `MAX_EFFECTIVE_BALANCE_ELECTRA` to config instead of preset HOT 2
- eth
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from consensus-specs.