Skip to main content

ILineaRollup

InitializationData

Initialization data structure for the LineaRollup contract.

Parameters

NameTypeDescription
struct InitializationData {
bytes32 initialStateRootHash;
uint256 initialL2BlockNumber;
uint256 genesisTimestamp;
address defaultVerifier;
uint256 rateLimitPeriodInSeconds;
uint256 rateLimitAmountInWei;
struct IPermissionsManager.RoleAddress[] roleAddresses;
struct IPauseManager.PauseTypeRole[] pauseTypeRoles;
struct IPauseManager.PauseTypeRole[] unpauseTypeRoles;
address fallbackOperator;
address defaultAdmin;
}

CompressedCalldataSubmission

Supporting data for compressed calldata submission including compressed data.

finalStateRootHash is used to set state root at the end of the data. snarkHash is the computed hash for compressed data (using a SNARK-friendly hash function) that aggregates per data submission to be used in public input. compressedData is the compressed transaction data. It contains ordered data for each L2 block - l2Timestamps, the encoded transaction data.

struct CompressedCalldataSubmission {
bytes32 finalStateRootHash;
bytes32 snarkHash;
bytes compressedData;
}

ShnarfData

Shnarf data for validating a shnarf.

parentShnarf is the parent computed shnarf. snarkHash is the computed hash for compressed data (using a SNARK-friendly hash function) that aggregates per data submission to be used in public input. finalStateRootHash is the final state root hash. dataEvaluationPoint is the data evaluation point. dataEvaluationClaim is the data evaluation claim.

struct ShnarfData {
bytes32 parentShnarf;
bytes32 snarkHash;
bytes32 finalStateRootHash;
bytes32 dataEvaluationPoint;
bytes32 dataEvaluationClaim;
}

BlobSubmission

Data stucture for compressed blob data submission.

submissionData The supporting data for blob data submission excluding the compressed data. dataEvaluationClaim The data evaluation claim. kzgCommitment The blob KZG commitment. kzgProof The blob KZG point proof.

struct BlobSubmission {
uint256 dataEvaluationClaim;
bytes kzgCommitment;
bytes kzgProof;
bytes32 finalStateRootHash;
bytes32 snarkHash;
}

FinalizationDataV3

Supporting data for finalization with proof.

NB: the dynamic sized fields are placed last on purpose for efficient keccaking on public input. parentStateRootHash is the expected last state root hash finalized. endBlockNumber is the end block finalizing until. shnarfData contains data about the last data submission's shnarf used in finalization. lastFinalizedTimestamp is the expected last finalized block's timestamp. finalTimestamp is the timestamp of the last block being finalized. lastFinalizedL1RollingHash is the last stored L2 computed rolling hash used in finalization. l1RollingHash is the calculated rolling hash on L2 that is expected to match L1 at l1RollingHashMessageNumber. This value will be used along with the stored last finalized L2 calculated rolling hash in the public input. lastFinalizedL1RollingHashMessageNumber is the last stored L2 computed message number used in finalization. l1RollingHashMessageNumber is the calculated message number on L2 that is expected to match the existing L1 rolling hash. This value will be used along with the stored last finalized L2 calculated message number in the public input. l2MerkleTreesDepth is the depth of all l2MerkleRoots. l2MerkleRoots is an array of L2 message Merkle roots of depth l2MerkleTreesDepth between last finalized block and finalSubmissionData.finalBlockNumber. l2MessagingBlocksOffsets indicates by offset from currentL2BlockNumber which L2 blocks contain MessageSent events.

struct FinalizationDataV3 {
bytes32 parentStateRootHash;
uint256 endBlockNumber;
struct ILineaRollup.ShnarfData shnarfData;
uint256 lastFinalizedTimestamp;
uint256 finalTimestamp;
bytes32 lastFinalizedL1RollingHash;
bytes32 l1RollingHash;
uint256 lastFinalizedL1RollingHashMessageNumber;
uint256 l1RollingHashMessageNumber;
uint256 l2MerkleTreesDepth;
bytes32[] l2MerkleRoots;
bytes l2MessagingBlocksOffsets;
}

LineaRollupVersionChanged

event LineaRollupVersionChanged(bytes8 previousVersion, bytes8 newVersion)

Emitted when the LineaRollup contract version has changed.

All bytes8 values are string based SemVer in the format M.m - e.g. "6.0".

Parameters

NameTypeDescription
previousVersionbytes8The previous version.
newVersionbytes8The new version.

FallbackOperatorRoleGranted

event FallbackOperatorRoleGranted(address caller, address fallbackOperator)

Emitted when the fallback operator role is granted.

Parameters

NameTypeDescription
calleraddressThe address that called the function granting the role.
fallbackOperatoraddressThe fallback operator address that received the operator role.

FallbackOperatorAddressSet

event FallbackOperatorAddressSet(address caller, address fallbackOperator)

Emitted when the fallback operator role is set on the contract.

Parameters

NameTypeDescription
calleraddressThe address that set the fallback operator address.
fallbackOperatoraddressThe fallback operator address.

VerifierAddressChanged

event VerifierAddressChanged(address verifierAddress, uint256 proofType, address verifierSetBy, address oldVerifierAddress)

Emitted when a verifier is set for a particular proof type.

The verifier will be set by an account with the VERIFIER_SETTER_ROLE. Typically the Safe. The oldVerifierAddress can be the zero address.

Parameters

NameTypeDescription
verifierAddressaddressThe indexed new verifier address being set.
proofTypeuint256The indexed proof type/index that the verifier is mapped to.
verifierSetByaddressThe index address who set the verifier at the mapping.
oldVerifierAddressaddressIndicates the previous address mapped to the proof type.

DataSubmittedV3

event DataSubmittedV3(bytes32 parentShnarf, bytes32 shnarf, bytes32 finalStateRootHash)

Emitted when compressed data is being submitted and verified succesfully on L1.

The block range is indexed and parent shnarf included for state reconstruction simplicity.

Parameters

NameTypeDescription
parentShnarfbytes32The parent shnarf for the data being submitted.
shnarfbytes32The indexed shnarf for the data being submitted.
finalStateRootHashbytes32The L2 state root hash that the current blob submission ends on. NB: The last blob in the collection.

DataFinalizedV3

event DataFinalizedV3(uint256 startBlockNumber, uint256 endBlockNumber, bytes32 shnarf, bytes32 parentStateRootHash, bytes32 finalStateRootHash)

Emitted when L2 blocks have been finalized on L1.

Parameters

NameTypeDescription
startBlockNumberuint256The indexed L2 block number indicating which block the finalization the data starts from.
endBlockNumberuint256The indexed L2 block number indicating which block the finalization the data ends on.
shnarfbytes32The indexed shnarf being set as currentFinalizedShnarf in the current finalization.
parentStateRootHashbytes32The parent L2 state root hash that the current finalization starts from.
finalStateRootHashbytes32The L2 state root hash that the current finalization ends on.

LastFinalizationTimeNotLapsed

error LastFinalizationTimeNotLapsed()

Thrown when the last finalization time has not lapsed when trying to grant the OPERATOR_ROLE to the fallback operator address.

PointEvaluationResponseInvalid

error PointEvaluationResponseInvalid(uint256 fieldElements, uint256 blsCurveModulus)

Thrown when the point evaluation precompile's call return data field(s) are wrong.

PrecompileReturnDataLengthWrong

error PrecompileReturnDataLengthWrong(uint256 expected, uint256 actual)

Thrown when the point evaluation precompile's call return data length is wrong.

PointEvaluationFailed

error PointEvaluationFailed()

Thrown when the point evaluation precompile call returns false.

EmptyBlobDataAtIndex

error EmptyBlobDataAtIndex(uint256 index)

Thrown when the blobhash at an index equals to the zero hash.

BlobSubmissionDataIsMissing

error BlobSubmissionDataIsMissing()

Thrown when the data for multiple blobs submission has length zero.

BlobSubmissionDataEmpty

error BlobSubmissionDataEmpty(uint256 emptyBlobIndex)

Thrown when a blob has been submitted but there is no data for it.

DataAlreadySubmitted

error DataAlreadySubmitted(bytes32 currentDataHash)

Thrown when the current data was already submitted.

EmptySubmissionData

error EmptySubmissionData()

Thrown when submissionData is empty.

L1RollingHashDoesNotExistOnL1

error L1RollingHashDoesNotExistOnL1(uint256 messageNumber, bytes32 rollingHash)

Thrown when finalizationData.l1RollingHash does not exist on L1 (Feedback loop).

FinalizationStateIncorrect

error FinalizationStateIncorrect(bytes32 expected, bytes32 value)

Thrown when finalization state does not match.

FinalBlockNumberLessThanOrEqualToLastFinalizedBlock

error FinalBlockNumberLessThanOrEqualToLastFinalizedBlock(uint256 finalBlockNumber, uint256 lastFinalizedBlock)

Thrown when the final block number in finalization data is less than or equal to the last finalized block during finalization.

FinalBlockStateEqualsZeroHash

error FinalBlockStateEqualsZeroHash()

Thrown when the final block state equals the zero hash during finalization.

FinalizationInTheFuture

error FinalizationInTheFuture(uint256 l2BlockTimestamp, uint256 currentBlockTimestamp)

Thrown when final l2 block timestamp higher than current block.timestamp during finalization.

MissingMessageNumberForRollingHash

error MissingMessageNumberForRollingHash(bytes32 rollingHash)

Thrown when a rolling hash is provided without a corresponding message number.

MissingRollingHashForMessageNumber

error MissingRollingHashForMessageNumber(uint256 messageNumber)

Thrown when a message number is provided without a corresponding rolling hash.

FirstByteIsNotZero

error FirstByteIsNotZero()

Thrown when the first byte is not zero. This is used explicitly with the four bytes in assembly 0x729eebce.

BytesLengthNotMultipleOf32

error BytesLengthNotMultipleOf32()

Thrown when bytes length is not a multiple of 32.

FinalShnarfWrong

error FinalShnarfWrong(bytes32 expected, bytes32 value)

Thrown when the computed shnarf does not match what is expected.

ParentBlobNotSubmitted

error ParentBlobNotSubmitted(bytes32 shnarf)

Thrown when a shnarf does not exist for a parent blob.

FinalBlobNotSubmitted

error FinalBlobNotSubmitted(bytes32 shnarf)

Thrown when a shnarf does not exist for the final blob being finalized.

OnlyNonFallbackOperator

error OnlyNonFallbackOperator()

Thrown when the fallback operator tries to renounce their operator role.

setVerifierAddress

function setVerifierAddress(address _newVerifierAddress, uint256 _proofType) external

Adds or updates the verifier contract address for a proof type.

VERIFIER_SETTER_ROLE is required to execute.

Parameters

NameTypeDescription
_newVerifierAddressaddressThe address for the verifier contract.
_proofTypeuint256The proof type being set/updated.

setFallbackOperator

function setFallbackOperator(uint256 _messageNumber, bytes32 _rollingHash, uint256 _lastFinalizedTimestamp) external

Sets the fallback operator role to the specified address if six months have passed since the last finalization.

Reverts if six months have not passed since the last finalization.

Parameters

NameTypeDescription
_messageNumberuint256Last finalized L1 message number as part of the feedback loop.
_rollingHashbytes32Last finalized L1 rolling hash as part of the feedback loop.
_lastFinalizedTimestampuint256Last finalized L2 block timestamp.

unsetVerifierAddress

function unsetVerifierAddress(uint256 _proofType) external

Unsets the verifier contract address for a proof type.

VERIFIER_UNSETTER_ROLE is required to execute.

Parameters

NameTypeDescription
_proofTypeuint256The proof type being set/updated.

submitBlobs

function submitBlobs(struct ILineaRollup.BlobSubmission[] _blobSubmissions, bytes32 _parentShnarf, bytes32 _finalBlobShnarf) external

Submit one or more EIP-4844 blobs.

OPERATOR_ROLE is required to execute. This should be a blob carrying transaction.

Parameters

NameTypeDescription
_blobSubmissionsstruct ILineaRollup.BlobSubmission[]The data for blob submission including proofs and required polynomials.
_parentShnarfbytes32The parent shnarf used in continuity checks as it includes the parentStateRootHash in its computation.
_finalBlobShnarfbytes32The expected final shnarf post computation of all the blob shnarfs.

submitDataAsCalldata

function submitDataAsCalldata(struct ILineaRollup.CompressedCalldataSubmission _submission, bytes32 _parentShnarf, bytes32 _expectedShnarf) external

Submit blobs using compressed data via calldata.

OPERATOR_ROLE is required to execute.

Parameters

NameTypeDescription
_submissionstruct ILineaRollup.CompressedCalldataSubmissionThe supporting data for compressed data submission including compressed data.
_parentShnarfbytes32The parent shnarf used in continuity checks as it includes the parentStateRootHash in its computation.
_expectedShnarfbytes32The expected shnarf post computation of all the submission.

finalizeBlocks

function finalizeBlocks(bytes _aggregatedProof, uint256 _proofType, struct ILineaRollup.FinalizationDataV3 _finalizationData) external

Finalize compressed blocks with proof.

OPERATOR_ROLE is required to execute.

Parameters

NameTypeDescription
_aggregatedProofbytesThe aggregated proof.
_proofTypeuint256The proof type.
_finalizationDatastruct ILineaRollup.FinalizationDataV3The full finalization data.