erigon-pulse/cmd/verkle/accessories.go
Giulio rebuffo bca221bf85
Refactored verkle tree state writer (#5357)
* verkle stuff

* added verkle writer

* added more stuff to verkle trees

* added tool for incremental prom.

* lint

Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
2022-09-13 15:05:58 +02:00

20 lines
378 B
Go

package main
import (
"encoding/binary"
"github.com/ledgerwatch/erigon-lib/kv"
"github.com/ledgerwatch/erigon/common"
)
func ReadVerkleIncarnation(tx kv.Tx, address common.Address) (uint64, error) {
inc, err := tx.GetOne(VerkleIncarnation, address[:])
if err != nil {
return 0, err
}
if len(inc) == 0 {
return 0, nil
}
return binary.BigEndian.Uint64(inc), nil
}