Skip to content

Commit

Permalink
feat: update ValidateAnchorTx
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Jan 18, 2025
1 parent c52652e commit 1098d0f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion consensus/taiko/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ var (
AnchorV2Selector = crypto.Keccak256(
[]byte("anchorV2(uint64,bytes32,uint32,(uint8,uint8,uint32,uint64,uint32))"),
)[:4]
AnchorV3Selector = crypto.Keccak256(
[]byte("anchorV2(uint64,bytes32,bytes32,uint32,(uint8,uint8,uint32,uint64,uint32),bytes32[])"),
)[:4]
AnchorGasLimit = uint64(250_000)
)

Expand Down Expand Up @@ -290,7 +293,9 @@ func (t *Taiko) ValidateAnchorTx(tx *types.Transaction, header *types.Header) (b
return false, nil
}

if !bytes.HasPrefix(tx.Data(), AnchorSelector) && !bytes.HasPrefix(tx.Data(), AnchorV2Selector) {
if !bytes.HasPrefix(tx.Data(), AnchorSelector) &&
!bytes.HasPrefix(tx.Data(), AnchorV2Selector) &&
!bytes.HasPrefix(tx.Data(), AnchorV3Selector) {
return false, nil
}

Expand Down

0 comments on commit 1098d0f

Please sign in to comment.