Skip to content

Commit

Permalink
Add skeleton code for Electra fork (#8008)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov authored Feb 23, 2024
1 parent 00fb79b commit a254e03
Show file tree
Hide file tree
Showing 121 changed files with 6,405 additions and 325 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void shouldGetBlindedBeaconBlockAsSsz() throws IOException {

@TestTemplate
void shouldGetUnBlindedBlockContentPostDenebAsJson() throws Exception {
assumeThat(specMilestone).isEqualTo(DENEB);
assumeThat(specMilestone).isGreaterThanOrEqualTo(DENEB);
final BlockContents blockContents = dataStructureUtil.randomBlockContents(ONE);
final BlockContainerAndMetaData blockContainerAndMetaData =
dataStructureUtil.randomBlockContainerAndMetaData(blockContents, ONE);
Expand All @@ -191,7 +191,7 @@ void shouldGetUnBlindedBlockContentPostDenebAsJson() throws Exception {

@TestTemplate
void shouldGetUnBlindedBlockContentPostDenebAsSsz() throws IOException {
assumeThat(specMilestone).isEqualTo(DENEB);
assumeThat(specMilestone).isGreaterThanOrEqualTo(DENEB);
final BlockContents blockContents = dataStructureUtil.randomBlockContents(ONE);
final BlockContainerAndMetaData blockContainerAndMetaData =
dataStructureUtil.randomBlockContainerAndMetaData(blockContents, ONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
"$ref" : "#/components/schemas/SignedBlindedBlockCapella"
}, {
"$ref" : "#/components/schemas/SignedBlindedBlockDeneb"
} ]
}, {
"$ref" : "#/components/schemas/SignedBlindedBlockElectra"
} ]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"$ref" : "#/components/schemas/SignedBeaconBlockCapella"
}, {
"$ref" : "#/components/schemas/SignedBlockContentsDeneb"
}, {
"$ref" : "#/components/schemas/SignedBlockContentsElectra"
} ]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"altair",
"bellatrix",
"capella",
"deneb"
"deneb",
"electra"
]
},
"data": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"$ref" : "#/components/schemas/SignedBlindedBlockCapella"
}, {
"$ref" : "#/components/schemas/SignedBlindedBlockDeneb"
} ]
}, {
"$ref" : "#/components/schemas/SignedBlindedBlockElectra"
} ]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"$ref" : "#/components/schemas/SignedBeaconBlockCapella"
}, {
"$ref" : "#/components/schemas/SignedBlockContentsDeneb"
} ]
}, {
"$ref" : "#/components/schemas/SignedBlockContentsElectra"
} ]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"title" : "BeaconBlockBodyElectra",
"type" : "object",
"required" : [ "randao_reveal", "eth1_data", "graffiti", "proposer_slashings", "attester_slashings", "attestations", "deposits", "voluntary_exits", "sync_aggregate", "execution_payload", "bls_to_execution_changes", "blob_kzg_commitments" ],
"properties" : {
"randao_reveal" : {
"type" : "string",
"pattern" : "^0x[a-fA-F0-9]{2,}$",
"description" : "SSZ hexadecimal",
"format" : "bytes"
},
"eth1_data" : {
"$ref" : "#/components/schemas/Eth1Data"
},
"graffiti" : {
"type" : "string",
"description" : "Bytes32 hexadecimal",
"example" : "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"format" : "byte"
},
"proposer_slashings" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/ProposerSlashing"
}
},
"attester_slashings" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/AttesterSlashing"
}
},
"attestations" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/Attestation"
}
},
"deposits" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/Deposit"
}
},
"voluntary_exits" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/SignedVoluntaryExit"
}
},
"sync_aggregate" : {
"$ref" : "#/components/schemas/SyncAggregate"
},
"execution_payload" : {
"$ref" : "#/components/schemas/ExecutionPayloadElectra"
},
"bls_to_execution_changes" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/SignedBLSToExecutionChange"
}
},
"blob_kzg_commitments" : {
"type" : "array",
"items" : {
"type" : "string",
"pattern" : "^0x[a-fA-F0-9]{2,}$",
"description" : "Bytes48 hexadecimal",
"format" : "bytes"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"title" : "BeaconBlockElectra",
"type" : "object",
"required" : [ "slot", "proposer_index", "parent_root", "state_root", "body" ],
"properties" : {
"slot" : {
"type" : "string",
"description" : "unsigned 64 bit integer",
"example" : "1",
"format" : "uint64"
},
"proposer_index" : {
"type" : "string",
"description" : "unsigned 64 bit integer",
"example" : "1",
"format" : "uint64"
},
"parent_root" : {
"type" : "string",
"description" : "Bytes32 hexadecimal",
"example" : "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"format" : "byte"
},
"state_root" : {
"type" : "string",
"description" : "Bytes32 hexadecimal",
"example" : "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"format" : "byte"
},
"body" : {
"$ref" : "#/components/schemas/BeaconBlockBodyElectra"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{
"title" : "BeaconStateElectra",
"type" : "object",
"required" : [ "genesis_time", "genesis_validators_root", "slot", "fork", "latest_block_header", "block_roots", "state_roots", "historical_roots", "eth1_data", "eth1_data_votes", "eth1_deposit_index", "validators", "balances", "randao_mixes", "slashings", "previous_epoch_participation", "current_epoch_participation", "justification_bits", "previous_justified_checkpoint", "current_justified_checkpoint", "finalized_checkpoint", "inactivity_scores", "current_sync_committee", "next_sync_committee", "latest_execution_payload_header", "next_withdrawal_index", "next_withdrawal_validator_index", "historical_summaries" ],
"properties" : {
"genesis_time" : {
"type" : "string",
"description" : "unsigned 64 bit integer",
"example" : "1",
"format" : "uint64"
},
"genesis_validators_root" : {
"type" : "string",
"description" : "Bytes32 hexadecimal",
"example" : "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"format" : "byte"
},
"slot" : {
"type" : "string",
"description" : "unsigned 64 bit integer",
"example" : "1",
"format" : "uint64"
},
"fork" : {
"$ref" : "#/components/schemas/Fork"
},
"latest_block_header" : {
"$ref" : "#/components/schemas/BeaconBlockHeader"
},
"block_roots" : {
"type" : "array",
"items" : {
"type" : "string",
"description" : "Bytes32 hexadecimal",
"example" : "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"format" : "byte"
}
},
"state_roots" : {
"type" : "array",
"items" : {
"type" : "string",
"description" : "Bytes32 hexadecimal",
"example" : "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"format" : "byte"
}
},
"historical_roots" : {
"type" : "array",
"items" : {
"type" : "string",
"description" : "Bytes32 hexadecimal",
"example" : "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"format" : "byte"
}
},
"eth1_data" : {
"$ref" : "#/components/schemas/Eth1Data"
},
"eth1_data_votes" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/Eth1Data"
}
},
"eth1_deposit_index" : {
"type" : "string",
"description" : "unsigned 64 bit integer",
"example" : "1",
"format" : "uint64"
},
"validators" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/Validator"
}
},
"balances" : {
"type" : "array",
"items" : {
"type" : "string",
"description" : "unsigned 64 bit integer",
"example" : "1",
"format" : "uint64"
}
},
"randao_mixes" : {
"type" : "array",
"items" : {
"type" : "string",
"description" : "Bytes32 hexadecimal",
"example" : "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"format" : "byte"
}
},
"slashings" : {
"type" : "array",
"items" : {
"type" : "string",
"description" : "unsigned 64 bit integer",
"example" : "1",
"format" : "uint64"
}
},
"previous_epoch_participation" : {
"type" : "array",
"items" : {
"type" : "string",
"example" : "1",
"description" : "unsigned 8 bit integer, max value 255",
"format" : "uint8"
}
},
"current_epoch_participation" : {
"type" : "array",
"items" : {
"type" : "string",
"example" : "1",
"description" : "unsigned 8 bit integer, max value 255",
"format" : "uint8"
}
},
"justification_bits" : {
"type" : "string",
"pattern" : "^0x[a-fA-F0-9]{2,}$",
"description" : "SSZ hexadecimal",
"format" : "bytes"
},
"previous_justified_checkpoint" : {
"$ref" : "#/components/schemas/Checkpoint"
},
"current_justified_checkpoint" : {
"$ref" : "#/components/schemas/Checkpoint"
},
"finalized_checkpoint" : {
"$ref" : "#/components/schemas/Checkpoint"
},
"inactivity_scores" : {
"type" : "array",
"items" : {
"type" : "string",
"description" : "unsigned 64 bit integer",
"example" : "1",
"format" : "uint64"
}
},
"current_sync_committee" : {
"$ref" : "#/components/schemas/SyncCommittee"
},
"next_sync_committee" : {
"$ref" : "#/components/schemas/SyncCommittee"
},
"latest_execution_payload_header" : {
"$ref" : "#/components/schemas/ExecutionPayloadHeaderElectra"
},
"next_withdrawal_index" : {
"type" : "string",
"description" : "unsigned 64 bit integer",
"example" : "1",
"format" : "uint64"
},
"next_withdrawal_validator_index" : {
"type" : "string",
"description" : "unsigned 64 bit integer",
"example" : "1",
"format" : "uint64"
},
"historical_summaries" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/HistoricalSummary"
}
}
}
}
Loading

0 comments on commit a254e03

Please sign in to comment.