triedb/pathdb: persist rawStorageKey as part of stateSet

This commit is contained in:
Zsolt Felfoldi 2025-01-12 14:00:09 +01:00
parent d6c8fc427c
commit f458ddef40

View file

@ -333,6 +333,9 @@ func (s *stateSet) updateSize(delta int) {
// encode serializes the content of state set into the provided writer. // encode serializes the content of state set into the provided writer.
func (s *stateSet) encode(w io.Writer) error { func (s *stateSet) encode(w io.Writer) error {
// Encode accounts // Encode accounts
if err := rlp.Encode(w, s.rawStorageKey); err != nil {
return err
}
type accounts struct { type accounts struct {
AddrHashes []common.Hash AddrHashes []common.Hash
Accounts [][]byte Accounts [][]byte
@ -370,6 +373,9 @@ func (s *stateSet) encode(w io.Writer) error {
// decode deserializes the content from the rlp stream into the state set. // decode deserializes the content from the rlp stream into the state set.
func (s *stateSet) decode(r *rlp.Stream) error { func (s *stateSet) decode(r *rlp.Stream) error {
if err := r.Decode(&s.rawStorageKey); err != nil {
return fmt.Errorf("load diff raw storage key flag: %v", err)
}
type accounts struct { type accounts struct {
AddrHashes []common.Hash AddrHashes []common.Hash
Accounts [][]byte Accounts [][]byte