Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the EIP-1271 ABI and Go bindings to use a bytes32 _hash parameter instead of arbitrary bytes _data, and aligns SSZ encoding offsets by removing outdated offset increments and enforcing exact offsets on decode.
- Remove per-field
offset += …in SSZ marshalling and change decode checks to strict equality - Update EIP-1271 ABI (
_data→_hash) and regenerate Go contract bindings - Fix the call site in
crypto/signature.goto pass the new[32]bytehash signature
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| types_encoding.go | Drop incremental offset += … adjustments and require exact offsets on decode |
| eip1271/eip1271.go | Swap ABI method to take bytes32 _hash, update Go binding signatures |
| eip1271/abi.abi | Change input name/type in ABI JSON from _data:bytes to _hash:bytes32 |
| crypto/signature.go | Call IsValidSignature with a [32]byte hash instead of a byte slice |
Comments suppressed due to low confidence (2)
types_encoding.go:669
- This loop for computing variable offsets was removed, but the
offsetvariable still drives subsequentWriteOffsetcalls. Without advancingoffset, later fields will encode with stale offsets. Restore or replace this logic sooffsetreflects the true byte length ofProofs.
dst = ssz.WriteOffset(dst, offset)
types_encoding.go:31
- Removing this
offset += len(o.PubKey)means theoffsetvariable never advances before the next dynamic field, so subsequent SSZ offsets will be wrong. Please reintroduce an offset increment or adjust the encoding loop to keep offsets in sync.
dst = append(dst, o.PubKey...)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#25