Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move core/types/accounts to erigon-lib/types/accounts #12955

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/verkle/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import (
"github.com/erigontech/erigon-lib/log/v3"

"github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/cmd/verkle/verkletrie"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/eth/stagedsync/stages"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/verkle/verkletrie/incrementAccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/erigontech/erigon-lib/log/v3"

"github.com/erigontech/erigon-lib/common/debug"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
)

func IncrementAccount(vTx kv.RwTx, tx kv.Tx, workers uint64, verkleWriter *VerkleTreeWriter, from, to uint64, tmpdir string) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/verkle/verkletrie/pedersen_hashstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (

"github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/common/debug"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
)

func RegeneratePedersenAccounts(outTx kv.RwTx, readTx kv.Tx, workers uint64, verkleWriter *VerkleTreeWriter) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/verkle/verkletrie/verkle_tree_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
"github.com/erigontech/erigon-lib/log/v3"

"github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/core/rawdb"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/turbo/trie/vtree"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/verkle/verkletrie/workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
libcommon "github.com/erigontech/erigon-lib/common"
"github.com/holiman/uint256"

"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/turbo/trie/vtree"
)

Expand Down
2 changes: 1 addition & 1 deletion consensus/clique/clique.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ import (
"github.com/erigontech/erigon-lib/kv/dbutils"
"github.com/erigontech/erigon-lib/log/v3"
"github.com/erigontech/erigon-lib/rlp"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/consensus"
"github.com/erigontech/erigon/core/state"
"github.com/erigontech/erigon/core/tracing"
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/core/vm/evmtypes"
"github.com/erigontech/erigon/params"
"github.com/erigontech/erigon/rpc"
Expand Down
2 changes: 1 addition & 1 deletion core/chain_makers.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ import (
"github.com/erigontech/erigon-lib/kv"
"github.com/erigontech/erigon-lib/rlp"
libstate "github.com/erigontech/erigon-lib/state"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/consensus"
"github.com/erigontech/erigon/consensus/merge"
"github.com/erigontech/erigon/consensus/misc"
"github.com/erigontech/erigon/core/state"
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/core/vm"
"github.com/erigontech/erigon/params"
"github.com/erigontech/erigon/polygon/heimdall"
Expand Down
2 changes: 1 addition & 1 deletion core/state/cached_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package state
import (
"github.com/erigontech/erigon-lib/common"

"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/turbo/shards"
)

Expand Down
2 changes: 1 addition & 1 deletion core/state/cached_reader3.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/erigontech/erigon-lib/kv"
"github.com/erigontech/erigon-lib/kv/kvcache"

"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
)

// CachedReader3 is a wrapper for an instance of type StateReader
Expand Down
2 changes: 1 addition & 1 deletion core/state/cached_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"github.com/erigontech/erigon-lib/common"

"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/turbo/shards"
)

Expand Down
2 changes: 1 addition & 1 deletion core/state/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/erigontech/erigon-lib/common"

"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion core/state/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/erigontech/erigon-lib/kv"
"github.com/erigontech/erigon-lib/kv/order"
"github.com/erigontech/erigon-lib/kv/rawdbv3"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/turbo/trie"
)

Expand Down
2 changes: 1 addition & 1 deletion core/state/history_reader_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/kv"
"github.com/erigontech/erigon-lib/state"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
)

// HistoryReaderV3 Implements StateReader and StateWriter
Expand Down
2 changes: 1 addition & 1 deletion core/state/intra_block_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import (
libcommon "github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/common/u256"
"github.com/erigontech/erigon-lib/crypto"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/core/tracing"
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/core/vm/evmtypes"
"github.com/erigontech/erigon/turbo/trie"
)
Expand Down
2 changes: 1 addition & 1 deletion core/state/rw_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"github.com/erigontech/erigon-lib/metrics"
"github.com/erigontech/erigon-lib/state"
libstate "github.com/erigontech/erigon-lib/state"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/turbo/shards"
)

Expand Down
2 changes: 1 addition & 1 deletion core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
libcommon "github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/crypto"
"github.com/erigontech/erigon-lib/rlp"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/core/tracing"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/turbo/trie"
)

Expand Down
2 changes: 1 addition & 1 deletion core/state/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import (
"github.com/erigontech/erigon-lib/log/v3"
"github.com/erigontech/erigon-lib/state"
stateLib "github.com/erigontech/erigon-lib/state"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/core/tracing"
"github.com/erigontech/erigon/core/types/accounts"
)

var toAddr = common.BytesToAddress
Expand Down
2 changes: 1 addition & 1 deletion core/state/state_writer_v4.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

libcommon "github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/kv"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
)

var _ StateWriter = (*WriterV4)(nil)
Expand Down
2 changes: 1 addition & 1 deletion core/state/txtask.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"github.com/erigontech/erigon-lib/chain"
libcommon "github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/state"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/core/vm/evmtypes"
)

Expand Down
2 changes: 1 addition & 1 deletion core/test/domains_restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ import (
"github.com/erigontech/erigon-lib/log/v3"
"github.com/erigontech/erigon-lib/state"
types2 "github.com/erigontech/erigon-lib/types"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/core"
reset2 "github.com/erigontech/erigon/core/rawdb/rawdbreset"
state2 "github.com/erigontech/erigon/core/state"
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/params"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,19 @@ func decodeLengthForHashing(buffer []byte, pos int) (length int, structure bool,
case firstByte < 192:
// Next byte is the length of the length + 183
lenEnd := pos + 1 + firstByte - 183
len := 0
for i := pos + 1; i < lenEnd; i++ {
len = (len << 8) + int(buffer[i])
length = (length << 8) + int(buffer[i])
}
return len, false, lenEnd
return length, false, lenEnd
case firstByte < 248:
return firstByte - 192, true, pos + 1
default:
// Next byte is the length of the length + 247
lenEnd := pos + 1 + firstByte - 247
len := 0
for i := pos + 1; i < lenEnd; i++ {
len = (len << 8) + int(buffer[i])
length = (length << 8) + int(buffer[i])
}
return len, true, lenEnd
return length, true, lenEnd
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ func TestEncodeAccountWithEmptyBalanceAndNotZeroIncarnation(t *testing.T) {
}

func isAccountsEqual(t *testing.T, src, dst Account) {
t.Helper()
if dst.Initialised != src.Initialised {
t.Fatal("cant decode the account Initialised", src.Initialised, dst.Initialised)
}
Expand Down Expand Up @@ -325,6 +326,7 @@ func TestIncarnationWithInvalidEncodedAccount(t *testing.T) {
}

func isIncarnationEqual(t *testing.T, initialIncarnation uint64, decodedIncarnation uint64) {
t.Helper()
if initialIncarnation != decodedIncarnation {
t.Fatal("Can't decode the incarnation", initialIncarnation, decodedIncarnation)
}
Expand Down
2 changes: 1 addition & 1 deletion eth/stagedsync/exec3.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ import (
"github.com/erigontech/erigon-lib/log/v3"
"github.com/erigontech/erigon-lib/metrics"
state2 "github.com/erigontech/erigon-lib/state"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon-lib/wrap"
"github.com/erigontech/erigon/core"
"github.com/erigontech/erigon/core/rawdb"
"github.com/erigontech/erigon/core/rawdb/rawdbhelpers"
"github.com/erigontech/erigon/core/rawdb/rawtemporaldb"
"github.com/erigontech/erigon/core/state"
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/eth/ethconfig/estimate"
"github.com/erigontech/erigon/eth/stagedsync/stages"
"github.com/erigontech/erigon/turbo/services"
Expand Down
2 changes: 1 addition & 1 deletion eth/stagedsync/stage_mining_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ import (
"github.com/erigontech/erigon-lib/kv/membatchwithdb"
"github.com/erigontech/erigon-lib/log/v3"
state2 "github.com/erigontech/erigon-lib/state"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon-lib/wrap"
"github.com/erigontech/erigon/consensus"
"github.com/erigontech/erigon/core"
"github.com/erigontech/erigon/core/rawdb"
"github.com/erigontech/erigon/core/state"
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/core/vm"
"github.com/erigontech/erigon/eth/stagedsync/stages"
"github.com/erigontech/erigon/params"
Expand Down
2 changes: 1 addition & 1 deletion eth/stagedsync/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"github.com/holiman/uint256"

libcommon "github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/core/state"
"github.com/erigontech/erigon/core/types/accounts"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion polygon/bor/bor.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ import (
"github.com/erigontech/erigon-lib/kv"
"github.com/erigontech/erigon-lib/log/v3"
"github.com/erigontech/erigon-lib/rlp"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/consensus"
"github.com/erigontech/erigon/consensus/misc"
"github.com/erigontech/erigon/core/rawdb"
"github.com/erigontech/erigon/core/state"
"github.com/erigontech/erigon/core/tracing"
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/core/vm/evmtypes"
"github.com/erigontech/erigon/eth/ethconfig/estimate"
"github.com/erigontech/erigon/params"
Expand Down
2 changes: 1 addition & 1 deletion turbo/adapter/ethapi/get_proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
libcommon "github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/common/length"

"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/turbo/trie"
)

Expand Down
2 changes: 1 addition & 1 deletion turbo/jsonrpc/debug_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
jsoniter "github.com/json-iterator/go"

"github.com/erigontech/erigon-lib/rlp"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/core/state"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/eth/stagedsync/stages"
tracersConfig "github.com/erigontech/erigon/eth/tracers/config"
"github.com/erigontech/erigon/rpc"
Expand Down
2 changes: 1 addition & 1 deletion turbo/jsonrpc/erigon_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import (
"github.com/erigontech/erigon/turbo/services"
"github.com/erigontech/erigon/turbo/snapshotsync/freezeblocks"

"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/core/rawdb"
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/rpc"
"github.com/erigontech/erigon/turbo/adapter/ethapi"
"github.com/erigontech/erigon/turbo/rpchelper"
Expand Down
2 changes: 1 addition & 1 deletion turbo/jsonrpc/eth_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ import (
"github.com/erigontech/erigon-lib/kv"
"github.com/erigontech/erigon-lib/kv/kvcache"
"github.com/erigontech/erigon-lib/log/v3"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/consensus"
"github.com/erigontech/erigon/consensus/misc"
"github.com/erigontech/erigon/core"
"github.com/erigontech/erigon/core/rawdb"
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/core/types/accounts"
ethFilters "github.com/erigontech/erigon/eth/filters"
"github.com/erigontech/erigon/ethdb/prune"
"github.com/erigontech/erigon/polygon/bor/borcfg"
Expand Down
2 changes: 1 addition & 1 deletion turbo/jsonrpc/eth_call.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import (
"github.com/erigontech/erigon-lib/kv"
"github.com/erigontech/erigon-lib/kv/rawdbv3"
"github.com/erigontech/erigon-lib/log/v3"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/core"
"github.com/erigontech/erigon/core/state"
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/core/vm"
"github.com/erigontech/erigon/core/vm/evmtypes"
"github.com/erigontech/erigon/eth/tracers/logger"
Expand Down
2 changes: 1 addition & 1 deletion turbo/jsonrpc/otterscan_contract_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/erigontech/erigon-lib/kv/order"
"github.com/erigontech/erigon-lib/kv/rawdbv3"

"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/turbo/rpchelper"
"github.com/erigontech/erigon/turbo/snapshotsync/freezeblocks"
)
Expand Down
2 changes: 1 addition & 1 deletion turbo/jsonrpc/otterscan_transaction_by_sender_and_nonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/erigontech/erigon-lib/kv/order"
"github.com/erigontech/erigon-lib/kv/rawdbv3"

"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/turbo/snapshotsync/freezeblocks"
)

Expand Down
2 changes: 1 addition & 1 deletion turbo/jsonrpc/trace_adhoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ import (
math2 "github.com/erigontech/erigon-lib/common/math"
"github.com/erigontech/erigon-lib/kv"
"github.com/erigontech/erigon-lib/log/v3"
"github.com/erigontech/erigon-lib/types/accounts"
"github.com/erigontech/erigon/core"
"github.com/erigontech/erigon/core/state"
"github.com/erigontech/erigon/core/types"
"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon/core/vm"
"github.com/erigontech/erigon/core/vm/evmtypes"
"github.com/erigontech/erigon/eth/tracers/config"
Expand Down
2 changes: 1 addition & 1 deletion turbo/shards/state_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
libcommon "github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/metrics"

"github.com/erigontech/erigon/core/types/accounts"
"github.com/erigontech/erigon-lib/types/accounts"
)

// LRU state cache consists of two structures - B-Tree and binary heap
Expand Down
Loading
Loading