Documentation ¶
Index ¶
Constants ¶
View Source
const BlockSize = 136
BlockSize is the size in bytes required for leaf data.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Challenge ¶
type Challenge struct { // StateMatrix is the packed state matrix preimage of the StateCommitment in Prestate StateMatrix []byte // TODO(client-pod#480): Need a better representation of this // Prestate is the valid leaf immediately prior to the first invalid leaf Prestate Leaf PrestateProof merkle.Proof // Poststate is the first invalid leaf in the preimage. The challenge claims that this leaf is invalid. Poststate Leaf PoststateProof merkle.Proof }
type InputData ¶
type InputData struct { // Input is the preimage data. // When Finalize is false, len(Input) must equal len(Commitments)*BlockSize // When Finalize is true, len(Input) must be between len(Commitments - 1)*BlockSize and len(Commitments)*BlockSize Input []byte // Commitments are the keccak commitments for each leaf in the chunk. Commitments []common.Hash // Finalize indicates whether the chunk is the final chunk. Finalize bool }
InputData is a contiguous segment of preimage data.
type LargePreimageMetaData ¶
type LargePreimageMetaData struct { LargePreimageIdent // Timestamp is the time at which the proposal first became fully available. // 0 when not all data is available yet Timestamp uint64 PartOffset uint32 ClaimedSize uint32 BlocksProcessed uint32 BytesProcessed uint32 Countered bool }
func (LargePreimageMetaData) ShouldVerify ¶
func (m LargePreimageMetaData) ShouldVerify() bool
ShouldVerify returns true if the preimage upload is complete and has not yet been countered. Note that the challenge period for the preimage may have expired but the image not yet been finalized.
type LargePreimageOracle ¶
type LargePreimageOracle interface { Addr() common.Address GetActivePreimages(ctx context.Context, blockHash common.Hash) ([]LargePreimageMetaData, error) GetInputDataBlocks(ctx context.Context, block batching.Block, ident LargePreimageIdent) ([]uint64, error) DecodeInputData(data []byte) (*big.Int, InputData, error) ChallengeTx(ident LargePreimageIdent, challenge Challenge) (txmgr.TxCandidate, error) }
type Leaf ¶
type Leaf struct { // Input is the data absorbed for the block, exactly 136 bytes Input [BlockSize]byte // Index of the block in the absorption process Index uint64 // StateCommitment is the hash of the internal state after absorbing the input. StateCommitment common.Hash }
Leaf is the keccak state matrix added to the large preimage merkle tree.
Click to show internal directories.
Click to hide internal directories.