Skip to content

Commit

Permalink
add blob type 3 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
laisolizq committed Apr 25, 2024
1 parent 8465a3c commit bd2c5c7
Show file tree
Hide file tree
Showing 13 changed files with 467 additions and 24 deletions.
52 changes: 52 additions & 0 deletions inputs-executor-blob/blob-empty-batches-4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"oldBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldBlobAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldNumBlob": 0,
"oldStateRoot": "0x799c98013da3f7a43b6e8086d0cedd89bd6a9bfef7179ce30755b27f7e9be302",
"forkID": 10,
"versionedHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blobType": 3,
"sequencerAddr": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D",
"zkGasLimit": "1000000000000000000",
"forcedHashData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blobL2HashData": "0xfa73acd1659a60eb17f78f45a2ae64b76168fb0f75fb1e052b1a7a26449962fb",
"newBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"newBlobAccInputHash": "0x3a43259d30ae8a0fc03e2db5ed7c2ba8fbc9b7a987f780f1cbc329ba58058721",
"newNumBlob": 1,
"finalAccBatchHashData": "0xc96c90f04743e766507b0b3300faf67cae4d8539d86a85cc90c2fa513689c201",
"localExitRootFromBlob": "0x0000000000000000000000000000000000000000000000000000000000000001",
"isInvalid": false,
"timestampLimit": "1944498031",
"lastL1InfoTreeIndex": 42,
"lastL1InfoTreeRoot": "0x4242424242424242424242424242424242424242424242424242424242424242",
"kzgCommitment": "0x0000000000000000000000000000000000000000000000000000000000000000",
"z": "0x0000000000000000000000000000000000000000000000000000000000000000",
"y": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blobData": "0x00000000fc0000007a0b73e6af6f00000000ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bff0000007a0b73e6af6f00000000ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bff",
"db": {
"0x799c98013da3f7a43b6e8086d0cedd89bd6a9bfef7179ce30755b27f7e9be302": [
"d4b99d5e267cec20",
"2411ee82c58136a0",
"6f22c92ea5923ea9",
"3dbcd178cbe3b0c6",
"d074b8cee5dcf415",
"2346a1b4c0f390e8",
"47969c1f5a6a25b1",
"da62fdf84a21108e",
"0000000000000001",
"0000000000000000",
"0000000000000000",
"0000000000000000"
],
"0xda62fdf84a21108e47969c1f5a6a25b12346a1b4c0f390e8d074b8cee5dcf415": [
"0000000000000001",
"0000000000000000",
"0000000000000000",
"0000000000000000",
"0000000000000000",
"0000000000000000",
"0000000000000000",
"0000000000000000"
]
}
}
52 changes: 52 additions & 0 deletions inputs-executor-blob/blob-empty-batches-5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"oldBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldBlobAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldNumBlob": 0,
"oldStateRoot": "0x799c98013da3f7a43b6e8086d0cedd89bd6a9bfef7179ce30755b27f7e9be302",
"forkID": 10,
"versionedHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blobType": 3,
"sequencerAddr": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D",
"zkGasLimit": "1000000000000000000",
"forcedHashData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blobL2HashData": "0x69b200370c1013bf84338016f55830723ba52fc2ca1ddb7313ccea3bf2746cfe",
"newBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"newBlobAccInputHash": "0xd88fd224d8146418c388683df929770b89bac0c1f5640c0dc9b78e049e54b206",
"newNumBlob": 1,
"finalAccBatchHashData": "0xc96c90f04743e766507b0b3300faf67cae4d8539d86a85cc90c2fa513689c201",
"localExitRootFromBlob": "0x0000000000000000000000000000000000000000000000000000000000000001",
"isInvalid": false,
"timestampLimit": "1944498031",
"lastL1InfoTreeIndex": 42,
"lastL1InfoTreeRoot": "0x4242424242424242424242424242424242424242424242424242424242424242",
"kzgCommitment": "0x0000000000000000000000000000000000000000000000000000000000000000",
"z": "0x0000000000000000000000000000000000000000000000000000000000000000",
"y": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blobData": "0x00000001000000007a0b73e6af6f00000000ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bff000000000000007a0b73e6af6f00000000ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bff",
"db": {
"0x799c98013da3f7a43b6e8086d0cedd89bd6a9bfef7179ce30755b27f7e9be302": [
"d4b99d5e267cec20",
"2411ee82c58136a0",
"6f22c92ea5923ea9",
"3dbcd178cbe3b0c6",
"d074b8cee5dcf415",
"2346a1b4c0f390e8",
"47969c1f5a6a25b1",
"da62fdf84a21108e",
"0000000000000001",
"0000000000000000",
"0000000000000000",
"0000000000000000"
],
"0xda62fdf84a21108e47969c1f5a6a25b12346a1b4c0f390e8d074b8cee5dcf415": [
"0000000000000001",
"0000000000000000",
"0000000000000000",
"0000000000000000",
"0000000000000000",
"0000000000000000",
"0000000000000000",
"0000000000000000"
]
}
}
17 changes: 8 additions & 9 deletions inputs-executor-blob/blob-inner-data-4.json

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions inputs-executor-blob/blob-inner-data-5.json

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions inputs-executor-blob/blob-inner-data-6.json

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions inputs-executor-blob/blob-inner-data-7.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions inputs-executor-blob/blob-invalid-8.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"oldStateRoot": "0x799c98013da3f7a43b6e8086d0cedd89bd6a9bfef7179ce30755b27f7e9be302",
"forkID": 10,
"versionedHash": "0x01f65e527f2ed1b01352dd1c566d1faa6c7acfbc439d45aefdfda6c505154716",
"blobType": 3,
"blobType": 4,
"sequencerAddr": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D",
"zkGasLimit": "1000000000000000000",
"forcedHashData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blobL2HashData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"newBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"newBlobAccInputHash": "0xd0faca52dee71beb710948b162250d46f995295a932ac2afcae8803a79724541",
"newBlobAccInputHash": "0xb93b4be685fab76fb57b7b1718ec95f71284a2baa47c9e5d8a910c733657b117",
"newNumBlob": 1,
"finalAccBatchHashData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"localExitRootFromBlob": "0x0000000000000000000000000000000000000000000000000000000000000001",
Expand Down
52 changes: 52 additions & 0 deletions inputs-executor-blob/blob-multiple-batches-6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"oldBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldBlobAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldNumBlob": 0,
"oldStateRoot": "0x799c98013da3f7a43b6e8086d0cedd89bd6a9bfef7179ce30755b27f7e9be302",
"forkID": 10,
"versionedHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blobType": 3,
"sequencerAddr": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D",
"zkGasLimit": "1000000000000000000",
"forcedHashData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blobL2HashData": "0x0dbec990c0ffb878a615109773d1191da991ae2985e8ab9ccdc3bfd92ee16fac",
"newBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"newBlobAccInputHash": "0x8c9809183d215de33307ba94da1df0ba0353f4ee4d09d454d10bc01b78622dfe",
"newNumBlob": 1,
"finalAccBatchHashData": "0x34b42c699593804d8807fc6ba22bd41733490b9da8fa52e257d0f07559574c8d",
"localExitRootFromBlob": "0x0000000000000000000000000000000000000000000000000000000000000001",
"isInvalid": false,
"timestampLimit": "1944498031",
"lastL1InfoTreeIndex": 42,
"lastL1InfoTreeRoot": "0x4242424242424242424242424242424242424242424242424242424242424242",
"kzgCommitment": "0x0000000000000000000000000000000000000000000000000000000000000000",
"z": "0x0000000000000000000000000000000000000000000000000000000000000000",
"y": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blobData": "0x00000001200000007a0b73e6af6f00000000ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bff00000020e391954c7419b2050aad54bbafb5a60ddae4de058e404a4b0f6e13c4b3e51b060000007a0b73e6af6f00000000ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bff",
"db": {
"0x799c98013da3f7a43b6e8086d0cedd89bd6a9bfef7179ce30755b27f7e9be302": [
"d4b99d5e267cec20",
"2411ee82c58136a0",
"6f22c92ea5923ea9",
"3dbcd178cbe3b0c6",
"d074b8cee5dcf415",
"2346a1b4c0f390e8",
"47969c1f5a6a25b1",
"da62fdf84a21108e",
"0000000000000001",
"0000000000000000",
"0000000000000000",
"0000000000000000"
],
"0xda62fdf84a21108e47969c1f5a6a25b12346a1b4c0f390e8d074b8cee5dcf415": [
"0000000000000001",
"0000000000000000",
"0000000000000000",
"0000000000000000",
"0000000000000000",
"0000000000000000",
"0000000000000000",
"0000000000000000"
]
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
],
"license": "pending",
"devDependencies": {
"@0xpolygonhermez/zkevm-commonjs": "github:0xPolygonHermez/zkevm-commonjs#feature/fix-computez",
"@0xpolygonhermez/zkevm-commonjs": "github:0xPolygonHermez/zkevm-commonjs#feature/add-blob-type-3",
"@0xpolygonhermez/zkevm-contracts": "github:0xPolygonHermez/zkevm-contracts#feature/fork-etrog",
"@grpc/grpc-js": "^1.6.10",
"@nomiclabs/hardhat-ethers": "^2.0.5",
Expand Down
75 changes: 75 additions & 0 deletions tools-inputs/data/blob/blob-empty-batches.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,80 @@
"isInvalid": false
},
"forkID": 10
},
{
"id": 4,
"description": "blob type 3, one valid batch + one valid batch",
"preExecution": {
"initLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"inputBlob": {
"publics": {
"oldBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldBlobAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldNumBlob": 0,
"oldStateRoot": "0x799c98013da3f7a43b6e8086d0cedd89bd6a9bfef7179ce30755b27f7e9be302"
},
"private": {
"lastL1InfoTreeIndex": 42,
"lastL1InfoTreeRoot": "0x4242424242424242424242424242424242424242424242424242424242424242",
"timestampLimit": "1944498031",
"sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D",
"blobType": 3,
"zkGasLimit": "1000000000000000000",
"forcedHashData": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"batchesData": [
"0x0b73e6af6f00000000ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bff",
"0x0b73e6af6f00000000ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bff"
],
"expected": {
"newBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"newBlobAccInputHash": "0x3a43259d30ae8a0fc03e2db5ed7c2ba8fbc9b7a987f780f1cbc329ba58058721",
"newNumBlob": 1,
"finalAccBatchHashData": "0xc96c90f04743e766507b0b3300faf67cae4d8539d86a85cc90c2fa513689c201",
"localExitRootFromBlob": "0x0000000000000000000000000000000000000000000000000000000000000001",
"isInvalid": false
},
"forkID": 10
},
{
"id": 5,
"description": "blob type 3, one valid batch + one empty batch + one valid batch",
"preExecution": {
"initLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"inputBlob": {
"publics": {
"oldBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldBlobAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldNumBlob": 0,
"oldStateRoot": "0x799c98013da3f7a43b6e8086d0cedd89bd6a9bfef7179ce30755b27f7e9be302"
},
"private": {
"lastL1InfoTreeIndex": 42,
"lastL1InfoTreeRoot": "0x4242424242424242424242424242424242424242424242424242424242424242",
"timestampLimit": "1944498031",
"sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D",
"blobType": 3,
"zkGasLimit": "1000000000000000000",
"forcedHashData": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"batchesData": [
"0x0b73e6af6f00000000ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bff",
"0x",
"0x0b73e6af6f00000000ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bff"
],
"expected": {
"newBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"newBlobAccInputHash": "0xd88fd224d8146418c388683df929770b89bac0c1f5640c0dc9b78e049e54b206",
"newNumBlob": 1,
"finalAccBatchHashData": "0xc96c90f04743e766507b0b3300faf67cae4d8539d86a85cc90c2fa513689c201",
"localExitRootFromBlob": "0x0000000000000000000000000000000000000000000000000000000000000001",
"isInvalid": false
},
"forkID": 10
}
]
72 changes: 71 additions & 1 deletion tools-inputs/data/blob/blob-inner-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,76 @@
},
{
"id": 4,
"description": "blob type 3, one valid batch",
"preExecution": {
"initLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"inputBlob": {
"publics": {
"oldBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldBlobAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldNumBlob": 0,
"oldStateRoot": "0x799c98013da3f7a43b6e8086d0cedd89bd6a9bfef7179ce30755b27f7e9be302"
},
"private": {
"lastL1InfoTreeIndex": 42,
"lastL1InfoTreeRoot": "0x4242424242424242424242424242424242424242424242424242424242424242",
"timestampLimit": "1944498031",
"sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D",
"blobType": 3,
"zkGasLimit": "1000000000000000000",
"forcedHashData": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"batchesData": [
"0x0b73e6af6f00000000ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bff"
],
"expected": {
"newBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"newBlobAccInputHash": "0xdd4a577866e14e7e7c3748ae7a97d567ae145f98da981294ca36a3398423b810",
"newNumBlob": 1,
"finalAccBatchHashData": "0xa78cd7278eb8b48a40e791486985ad6290af374ca45ad962ed08cc83b2e184ba",
"localExitRootFromBlob": "0x0000000000000000000000000000000000000000000000000000000000000001",
"isInvalid": false
},
"forkID": 10
},
{
"id": 5,
"description": "blob type 3, one valid batch (blobData)",
"preExecution": {
"initLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"inputBlob": {
"publics": {
"oldBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldBlobAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"oldNumBlob": 0,
"oldStateRoot": "0x799c98013da3f7a43b6e8086d0cedd89bd6a9bfef7179ce30755b27f7e9be302"
},
"private": {
"lastL1InfoTreeIndex": 42,
"lastL1InfoTreeRoot": "0x4242424242424242424242424242424242424242424242424242424242424242",
"timestampLimit": "1944498031",
"sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D",
"blobType": 3,
"zkGasLimit": "1000000000000000000",
"forcedHashData": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"blobData": "0x000000007e0000007a0b73e6af6f00000000ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bff",
"expected": {
"newBlobStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"newBlobAccInputHash": "0xdd4a577866e14e7e7c3748ae7a97d567ae145f98da981294ca36a3398423b810",
"newNumBlob": 1,
"finalAccBatchHashData": "0xa78cd7278eb8b48a40e791486985ad6290af374ca45ad962ed08cc83b2e184ba",
"localExitRootFromBlob": "0x0000000000000000000000000000000000000000000000000000000000000001",
"isInvalid": false
},
"forkID": 10
},
{
"id": 6,
"description": "blob type 1, one valid batch",
"preExecution": {
"initLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000001"
Expand Down Expand Up @@ -176,7 +246,7 @@
"forkID": 10
},
{
"id": 5,
"id": 7,
"description": "blob type 1, one valid batch (blobData)",
"preExecution": {
"initLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000001"
Expand Down
4 changes: 2 additions & 2 deletions tools-inputs/data/blob/blob-invalid.json

Large diffs are not rendered by default.

Loading

0 comments on commit bd2c5c7

Please sign in to comment.