move `KzgCommitments` to `base`
Preparation for EIP-7495 SSZ `StableContainer` which can only contain immutable types in their fields.
This commit is contained in:
parent
ebf285f3dd
commit
06e4ad5faa
|
@ -70,9 +70,11 @@ import
|
||||||
../../version,
|
../../version,
|
||||||
".."/[beacon_time, crypto, digest, presets]
|
".."/[beacon_time, crypto, digest, presets]
|
||||||
|
|
||||||
|
from kzg4844 import KzgCommitment
|
||||||
|
|
||||||
export
|
export
|
||||||
tables, results, endians2, json_serialization, sszTypes, beacon_time, crypto,
|
tables, results, endians2, json_serialization, sszTypes, beacon_time, crypto,
|
||||||
digest, presets
|
digest, presets, kzg4844
|
||||||
|
|
||||||
const SPEC_VERSION* = "1.5.0-alpha.2"
|
const SPEC_VERSION* = "1.5.0-alpha.2"
|
||||||
## Spec version we're aiming to be compatible with, right now
|
## Spec version we're aiming to be compatible with, right now
|
||||||
|
@ -422,6 +424,9 @@ type
|
||||||
SignedBLSToExecutionChangeList* =
|
SignedBLSToExecutionChangeList* =
|
||||||
List[SignedBLSToExecutionChange, Limit MAX_BLS_TO_EXECUTION_CHANGES]
|
List[SignedBLSToExecutionChange, Limit MAX_BLS_TO_EXECUTION_CHANGES]
|
||||||
|
|
||||||
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/deneb/beacon-chain.md#beaconblockbody
|
||||||
|
KzgCommitments* = List[KzgCommitment, Limit MAX_BLOB_COMMITMENTS_PER_BLOCK]
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/capella/beacon-chain.md#historicalsummary
|
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/capella/beacon-chain.md#historicalsummary
|
||||||
HistoricalSummary* = object
|
HistoricalSummary* = object
|
||||||
# `HistoricalSummary` matches the components of the phase0
|
# `HistoricalSummary` matches the components of the phase0
|
||||||
|
|
|
@ -36,9 +36,6 @@ const
|
||||||
BLS_MODULUS* = "52435875175126190479447740508185965837690552500527637822603658699938581184513".u256
|
BLS_MODULUS* = "52435875175126190479447740508185965837690552500527637822603658699938581184513".u256
|
||||||
|
|
||||||
type
|
type
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/deneb/beacon-chain.md#beaconblockbody
|
|
||||||
KzgCommitments* = List[KzgCommitment, Limit MAX_BLOB_COMMITMENTS_PER_BLOCK]
|
|
||||||
|
|
||||||
# TODO this apparently is suppposed to be SSZ-equivalent to Bytes32, but
|
# TODO this apparently is suppposed to be SSZ-equivalent to Bytes32, but
|
||||||
# current spec doesn't ever SSZ-serialize it or hash_tree_root it
|
# current spec doesn't ever SSZ-serialize it or hash_tree_root it
|
||||||
# TODO make `distinct` then add a REST serialization for it specifically, via
|
# TODO make `distinct` then add a REST serialization for it specifically, via
|
||||||
|
@ -51,7 +48,8 @@ type
|
||||||
BlobIndex* = uint64
|
BlobIndex* = uint64
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/polynomial-commitments.md#custom-types
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/deneb/polynomial-commitments.md#custom-types
|
||||||
Blob* = array[BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_BLOB, byte]
|
Blob* = array[
|
||||||
|
BYTES_PER_FIELD_ELEMENT * deneb_preset.FIELD_ELEMENTS_PER_BLOB, byte]
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/deneb/p2p-interface.md#blobsidecar
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0/specs/deneb/p2p-interface.md#blobsidecar
|
||||||
BlobSidecar* = object
|
BlobSidecar* = object
|
||||||
|
@ -616,7 +614,7 @@ func kzg_commitment_inclusion_proof_gindex*(
|
||||||
(BLOB_KZG_COMMITMENTS_GINDEX shl 1) + 0
|
(BLOB_KZG_COMMITMENTS_GINDEX shl 1) + 0
|
||||||
# List depth
|
# List depth
|
||||||
BLOB_KZG_COMMITMENTS_PROOF_DEPTH =
|
BLOB_KZG_COMMITMENTS_PROOF_DEPTH =
|
||||||
log2trunc(nextPow2(deneb.KzgCommitments.maxLen.uint64))
|
log2trunc(nextPow2(KzgCommitments.maxLen.uint64))
|
||||||
# First item
|
# First item
|
||||||
BLOB_KZG_COMMITMENTS_FIRST_GINDEX =
|
BLOB_KZG_COMMITMENTS_FIRST_GINDEX =
|
||||||
(BLOB_KZG_COMMITMENTS_BASE_GINDEX shl BLOB_KZG_COMMITMENTS_PROOF_DEPTH)
|
(BLOB_KZG_COMMITMENTS_BASE_GINDEX shl BLOB_KZG_COMMITMENTS_PROOF_DEPTH)
|
||||||
|
|
Loading…
Reference in New Issue