Repository navigation
Revert "Add Core interop transaction signing and WASM bindings (#1)" - #97
Conversation
| if value != AttributeTypeToConfig[key].NilValue { | ||
| return false |
There was a problem hiding this comment.
🟡 Unknown attributes crash transaction hash aggregation
When AggregateTxHash receives an unknown attribute type, IsEmpty panics while reading its missing configuration. Previously, it treated that attribute as nonempty.
Learn more
L2TxAttributes is a public map, so callers can supply keys absent from AttributeTypeToConfig. AggregateTxHash calls IsEmpty without first calling Validate. An unknown key produces a nil config and a panic before the hash operation returns. Validate now checks all nonempty maps, but that does not protect direct calls to AggregateTxHash.
Example: Calling txtypes.L2TxAttributes{9: 0}.AggregateTxHash(hash) panics in IsEmpty; before this change, IsEmpty returned false.
Recommended fix: Restore the missing-config check in IsEmpty so invalid types remain nonempty without dereferencing nil. Keep the new Validate entry condition so Validate rejects unknown types.
| if value != AttributeTypeToConfig[key].NilValue { | |
| return false | |
| config, ok := AttributeTypeToConfig[key] | |
| if !ok || value != config.NilValue { |
Was this helpful? React with 👍 or 👎 to provide feedback.
Reverts #95