mirror of
https://github.com/vacp2p/linea-monorepo.git
synced 2026-01-09 20:27:58 -05:00
Check parent shnarf exists for calldata submission (#223)
This commit is contained in:
@@ -301,6 +301,10 @@ contract LineaRollup is
|
||||
revert EmptySubmissionData();
|
||||
}
|
||||
|
||||
if (blobShnarfExists[_parentShnarf] == 0) {
|
||||
revert ParentBlobNotSubmitted(_parentShnarf);
|
||||
}
|
||||
|
||||
bytes32 currentDataHash = keccak256(_submission.compressedData);
|
||||
|
||||
bytes32 dataEvaluationPoint = Utils._efficientKeccak(_submission.snarkHash, currentDataHash);
|
||||
|
||||
@@ -391,6 +391,16 @@ describe("Linea Rollup contract", () => {
|
||||
await expectRevertWithCustomError(lineaRollup, submitDataCall, "EmptySubmissionData");
|
||||
});
|
||||
|
||||
it("Should fail when the parent shnarf does not exist", async () => {
|
||||
const [submissionData] = generateCallDataSubmission(0, 1);
|
||||
const nonExistingParentShnarf = generateRandomBytes(32);
|
||||
const asyncCall = lineaRollup
|
||||
.connect(operator)
|
||||
.submitDataAsCalldata(submissionData, nonExistingParentShnarf, expectedShnarf, { gasLimit: 30_000_000 });
|
||||
|
||||
await expectRevertWithCustomError(lineaRollup, asyncCall, "ParentBlobNotSubmitted", [nonExistingParentShnarf]);
|
||||
});
|
||||
|
||||
it("Should succesfully submit 1 compressed data chunk setting values", async () => {
|
||||
const [submissionData] = generateCallDataSubmission(0, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user