mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-04-23 03:00:50 -04:00
fix commit tx missing StorageKeys
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user