Skip to content

Commit

Permalink
fix: continue the tx validation loop if assetId length check fails (#18)
Browse files Browse the repository at this point in the history
Currently, we check if the length of the assetId sent by the rollup is
of 32 bytes. If the check fails, we still continue executing the code
which will lead to a panic as in the subsequent we try to index the
bytes.

The fix would be to ignore this tx when the validation fails
  • Loading branch information
bharath-123 authored May 21, 2024
1 parent ed9c11a commit 03f5d7e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions grpc/execution/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ func (s *ExecutionServiceServerV1Alpha2) ExecuteBlock(ctx context.Context, req *

if len(deposit.AssetId) != 32 {
log.Debug("ignoring deposit tx with invalid asset ID", "assetID", deposit.AssetId)
continue
}
assetID := [32]byte{}
copy(assetID[:], deposit.AssetId[:32])
Expand Down

0 comments on commit 03f5d7e

Please sign in to comment.