BAL: StorageChange to uint256, rename Data to Bytecode#19134
Conversation
execution/types/block_access_list.go
Outdated
| } | ||
| sc.Index = uint16(idx) | ||
| value, err := decodeUint256Hash(s) | ||
| valBytes, err := s.Bytes() |
There was a problem hiding this comment.
You can simply use s.Uint256()
There was a problem hiding this comment.
Pull request overview
This PR updates the Block Access List (BAL) data model to use uint256.Int directly for storage values and renames CodeChange.Data to CodeChange.Bytecode, propagating the changes through RLP encoding/decoding, proto conversions, and related tests.
Changes:
- Change
StorageChange.Valuetype fromcommon.Hashtouint256.Int, updating RLP encode/decode logic accordingly. - Rename
CodeChange.DatatoCodeChange.Bytecodeand update serialization/debug/proto conversion code paths. - Update BAL creation/version map logic and adjust affected tests to the new types/field names.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| execution/types/block_access_list.go | Core BAL type updates (storage value type + code field rename), plus RLP + proto conversion updates. |
| execution/types/block_access_list_test.go | Updates BAL RLP encoding test vectors/fixtures to use uint256.Int and Bytecode. |
| execution/state/versionmap.go | Adapts version map write logic to consume storage values as uint256.Int and code as Bytecode. |
| execution/stagedsync/bal_create.go | Updates BAL creation to record storage writes as uint256.Int and code changes as Bytecode. |
| execution/stagedsync/bal_create_test.go | Updates assertions to read uint256.Int values directly. |
| execution/execmodule/moduleutil/grpc_test.go | Updates test BAL fixtures to use uint256.Int and Bytecode. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
execution/types/block_access_list.go
Outdated
| val := change.Value | ||
| slotChanges.Changes = append(slotChanges.Changes, &typesproto.BlockAccessListStorageChange{ | ||
| Index: uint32(change.Index), | ||
| Value: gointerfaces.ConvertHashToH256(change.Value), | ||
| Value: gointerfaces.ConvertUint256IntToH256(&val), | ||
| }) |
There was a problem hiding this comment.
Unnecessary copy of the uint256.Int before converting to H256. Since change is already a pointer, you can pass &change.Value directly to ConvertUint256IntToH256 to avoid an extra copy and simplify the code.
execution/types/block_access_list.go
Outdated
| val := change.Value | ||
| slotChanges.Changes = append(slotChanges.Changes, &executionproto.BlockAccessListStorageChange{ | ||
| Index: uint32(change.Index), | ||
| Value: gointerfaces.ConvertHashToH256(change.Value), | ||
| Value: gointerfaces.ConvertUint256IntToH256(&val), | ||
| }) |
There was a problem hiding this comment.
Unnecessary copy of the uint256.Int before converting to H256. Since change is already a pointer, you can pass &change.Value directly to ConvertUint256IntToH256 to avoid an extra copy and simplify the code.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.