good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit dc75f767 authored by Alex Sharov's avatar Alex Sharov Committed by GitHub
Browse files

Parlia: log prefix and less logs #4128

parent 8703bb67
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ import ( ...@@ -6,6 +6,7 @@ import (
"github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon-lib/kv"
"github.com/ledgerwatch/erigon/common" "github.com/ledgerwatch/erigon/common"
"github.com/ledgerwatch/erigon/common/dbutils"
"github.com/ledgerwatch/erigon/core/types/accounts" "github.com/ledgerwatch/erigon/core/types/accounts"
) )
...@@ -16,8 +17,6 @@ var _ StateReader = (*PlainStateReader)(nil) ...@@ -16,8 +17,6 @@ var _ StateReader = (*PlainStateReader)(nil)
// as opposed to the "normal" state that uses hashes of merkle paths to store items. // as opposed to the "normal" state that uses hashes of merkle paths to store items.
type PlainStateReader struct { type PlainStateReader struct {
db kv.Getter db kv.Getter
buf [common.AddressLength + common.IncarnationLength + common.HashLength]byte
} }
func NewPlainStateReader(db kv.Getter) *PlainStateReader { func NewPlainStateReader(db kv.Getter) *PlainStateReader {
...@@ -42,11 +41,8 @@ func (r *PlainStateReader) ReadAccountData(address common.Address) (*accounts.Ac ...@@ -42,11 +41,8 @@ func (r *PlainStateReader) ReadAccountData(address common.Address) (*accounts.Ac
} }
func (r *PlainStateReader) ReadAccountStorage(address common.Address, incarnation uint64, key *common.Hash) ([]byte, error) { func (r *PlainStateReader) ReadAccountStorage(address common.Address, incarnation uint64, key *common.Hash) ([]byte, error) {
copy(r.buf[:], address[:]) compositeKey := dbutils.PlainGenerateCompositeStorageKey(address.Bytes(), incarnation, key.Bytes())
binary.BigEndian.PutUint64(r.buf[common.AddressLength:], incarnation) enc, err := r.db.GetOne(kv.PlainState, compositeKey)
copy(r.buf[common.AddressLength+common.IncarnationLength:], key[:])
enc, err := r.db.GetOne(kv.PlainState, r.buf[:])
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment