mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-06 06:58:39 +00:00
parent
bc1967f088
commit
13d8df63f4
1 changed files with 5 additions and 0 deletions
|
|
@ -178,6 +178,11 @@ func isStrictlySortedFunc[S ~[]E, E any](x S, cmp func(a, b E) int) bool {
|
||||||
// which are ordered ascending by transaction index and contain no duplicate
|
// which are ordered ascending by transaction index and contain no duplicate
|
||||||
// modifications for a given index.
|
// modifications for a given index.
|
||||||
func (e *encodingSlotChanges) validate(maxBALIndex int) error {
|
func (e *encodingSlotChanges) validate(maxBALIndex int) error {
|
||||||
|
// Each SlotChanges entry MUST contain at least one StorageChange.
|
||||||
|
if len(e.SlotChanges) == 0 {
|
||||||
|
return errors.New("empty slot changes")
|
||||||
|
}
|
||||||
|
// Each storage key MUST appear at most once in storage_changes per account.
|
||||||
if !isStrictlySortedFunc(e.SlotChanges, func(a, b encodingStorageWrite) int {
|
if !isStrictlySortedFunc(e.SlotChanges, func(a, b encodingStorageWrite) int {
|
||||||
return cmp.Compare(a.BlockAccessIndex, b.BlockAccessIndex)
|
return cmp.Compare(a.BlockAccessIndex, b.BlockAccessIndex)
|
||||||
}) {
|
}) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue