fix commit tx missing StorageKeys

This commit is contained in:
georgehao
2026-03-09 19:47:52 +08:00
parent 9b2b5e0cad
commit 566e4ee4da
2 changed files with 10 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ import (
"runtime/debug"
)
var tag = "v4.7.12"
var tag = "v4.7.13"
var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {

View File

@@ -168,8 +168,15 @@ func finetuneAccessList(accessList *types.AccessList, gasLimitWithAccessList uin
// Each storage key saves 100 gas units.
gasLimitWithAccessList += uint64(100 * len(entry.StorageKeys))
} else {
// Otherwise, keep the entry in the new access list.
newAccessList = append(newAccessList, entry)
// Ensure StorageKeys is never nil to avoid "missing required field 'storageKeys'" error during JSON serialization.
storageKeys := entry.StorageKeys
if storageKeys == nil {
storageKeys = []common.Hash{}
}
newAccessList = append(newAccessList, types.AccessTuple{
Address: entry.Address,
StorageKeys: storageKeys,
})
}
}
return &newAccessList, gasLimitWithAccessList