Skip to content

Commit

Permalink
tweak(zkevm_api): allow 0x00 accinputhash (#1421)
Browse files Browse the repository at this point in the history
  • Loading branch information
revitteth authored Nov 7, 2024
1 parent c86a851 commit 050949a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions turbo/jsonrpc/zkevm_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,9 @@ func (api *ZkEvmAPIImpl) getAccInputHash(ctx context.Context, db SequenceReader,
}

accInputHash = &prevSequenceAccinputHash
if prevSequenceBatch == 0 {
return
}
// calculate acc input hash
for i := 0; i < int(batchNum-prevSequenceBatch); i++ {
accInputHash = accInputHashCalcFn(prevSequenceAccinputHash, i)
Expand Down
2 changes: 1 addition & 1 deletion turbo/jsonrpc/zkevm_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ func TestGetBatchByNumber(t *testing.T) {
assert.Equal(gers[len(gers)-1], batch.GlobalExitRoot)
assert.Equal(mainnetExitRoots[len(mainnetExitRoots)-1], batch.MainnetExitRoot)
assert.Equal(rollupExitRoots[len(rollupExitRoots)-1], batch.RollupExitRoot)
assert.Equal(common.HexToHash("0x97d1524156ccb46723e5c3c87951da9a390499ba288161d879df1dbc03d49afc"), batch.AccInputHash)
assert.Equal(common.HexToHash(common.Hash{}.String()), batch.AccInputHash)
assert.Equal(common.HexToHash("0x22ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba97"), *batch.SendSequencesTxHash)
assert.Equal(rpctypes.ArgUint64(1714427009), batch.Timestamp)
assert.Equal(true, batch.Closed)
Expand Down

0 comments on commit 050949a

Please sign in to comment.