mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-15 12:36:48 +00:00
core/rawdb: correct misleading comments for state history accessors (#32783)
This commit is contained in:
parent
e42af536c5
commit
695c1445ab
1 changed files with 19 additions and 12 deletions
|
|
@ -170,9 +170,11 @@ func ReadStateHistoryMetaList(db ethdb.AncientReaderOp, start uint64, count uint
|
||||||
return db.AncientRange(stateHistoryMeta, start-1, count, 0)
|
return db.AncientRange(stateHistoryMeta, start-1, count, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadStateAccountIndex retrieves the state root corresponding to the specified
|
// ReadStateAccountIndex retrieves the account index blob for the specified
|
||||||
// state history. Compute the position of state history in freezer by minus one
|
// state history. The index contains fixed-size entries with offsets and lengths
|
||||||
// since the id of first state history starts from one(zero for initial state).
|
// into the concatenated account data table. Compute the position of state
|
||||||
|
// history in freezer by minus one since the id of first state history starts
|
||||||
|
// from one (zero for initial state).
|
||||||
func ReadStateAccountIndex(db ethdb.AncientReaderOp, id uint64) []byte {
|
func ReadStateAccountIndex(db ethdb.AncientReaderOp, id uint64) []byte {
|
||||||
blob, err := db.Ancient(stateHistoryAccountIndex, id-1)
|
blob, err := db.Ancient(stateHistoryAccountIndex, id-1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -181,9 +183,11 @@ func ReadStateAccountIndex(db ethdb.AncientReaderOp, id uint64) []byte {
|
||||||
return blob
|
return blob
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadStateStorageIndex retrieves the state root corresponding to the specified
|
// ReadStateStorageIndex retrieves the storage index blob for the specified
|
||||||
// state history. Compute the position of state history in freezer by minus one
|
// state history. The index contains fixed-size entries that locate storage slot
|
||||||
// since the id of first state history starts from one(zero for initial state).
|
// data in the concatenated storage data table. Compute the position of state
|
||||||
|
// history in freezer by minus one since the id of first state history starts
|
||||||
|
// from one (zero for initial state).
|
||||||
func ReadStateStorageIndex(db ethdb.AncientReaderOp, id uint64) []byte {
|
func ReadStateStorageIndex(db ethdb.AncientReaderOp, id uint64) []byte {
|
||||||
blob, err := db.Ancient(stateHistoryStorageIndex, id-1)
|
blob, err := db.Ancient(stateHistoryStorageIndex, id-1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -192,9 +196,10 @@ func ReadStateStorageIndex(db ethdb.AncientReaderOp, id uint64) []byte {
|
||||||
return blob
|
return blob
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadStateAccountHistory retrieves the state root corresponding to the specified
|
// ReadStateAccountHistory retrieves the concatenated account data blob for the
|
||||||
// state history. Compute the position of state history in freezer by minus one
|
// specified state history. Offsets and lengths are resolved via the account
|
||||||
// since the id of first state history starts from one(zero for initial state).
|
// index. Compute the position of state history in freezer by minus one since
|
||||||
|
// the id of first state history starts from one (zero for initial state).
|
||||||
func ReadStateAccountHistory(db ethdb.AncientReaderOp, id uint64) []byte {
|
func ReadStateAccountHistory(db ethdb.AncientReaderOp, id uint64) []byte {
|
||||||
blob, err := db.Ancient(stateHistoryAccountData, id-1)
|
blob, err := db.Ancient(stateHistoryAccountData, id-1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -203,9 +208,11 @@ func ReadStateAccountHistory(db ethdb.AncientReaderOp, id uint64) []byte {
|
||||||
return blob
|
return blob
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadStateStorageHistory retrieves the state root corresponding to the specified
|
// ReadStateStorageHistory retrieves the concatenated storage slot data blob for
|
||||||
// state history. Compute the position of state history in freezer by minus one
|
// the specified state history. Locations are resolved via the account and
|
||||||
// since the id of first state history starts from one(zero for initial state).
|
// storage indexes. Compute the position of state history in freezer by minus
|
||||||
|
// one since the id of first state history starts from one (zero for initial
|
||||||
|
// state).
|
||||||
func ReadStateStorageHistory(db ethdb.AncientReaderOp, id uint64) []byte {
|
func ReadStateStorageHistory(db ethdb.AncientReaderOp, id uint64) []byte {
|
||||||
blob, err := db.Ancient(stateHistoryStorageData, id-1)
|
blob, err := db.Ancient(stateHistoryStorageData, id-1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue