From 5065089c3d5cce5c361c1f00122aa10ac86be826 Mon Sep 17 00:00:00 2001 From: philip-morlier Date: Wed, 24 Jan 2024 14:55:49 -0800 Subject: [PATCH] Merged Use the statedb database to get Tries PR into merge PR --- plugins/test-plugin/test/run-test.sh | 6 +++--- plugins/wrappers/backendwrapper/backendwrapper.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/test-plugin/test/run-test.sh b/plugins/test-plugin/test/run-test.sh index 861c6f62f..15130812b 100755 --- a/plugins/test-plugin/test/run-test.sh +++ b/plugins/test-plugin/test/run-test.sh @@ -37,17 +37,17 @@ echo -n "supersecretpassword" > passwordfile # $GETH init --datadir=./02 genesis.json # miner node -$GETH --cache.preimages --config config00.toml --authrpc.port 8552 --port 64480 --verbosity=0 --nodiscover --networkid=6448 --datadir=./00/ --mine --miner.etherbase f2c207111cb6ef761e439e56b25c7c99ac026a01 --unlock f2c207111cb6ef761e439e56b25c7c99ac026a01 --http --http.api eth,debug,net --http.port 9545 --password passwordfile --allow-insecure-unlock & +$GETH --cache.preimages --config config00.toml --authrpc.port 8552 --pprof --pprof.port=6767 --port 64480 --verbosity=0 --nodiscover --networkid=6448 --datadir=./00/ --mine --miner.etherbase f2c207111cb6ef761e439e56b25c7c99ac026a01 --unlock f2c207111cb6ef761e439e56b25c7c99ac026a01 --http --http.api eth,debug,net --http.port 9545 --password passwordfile --allow-insecure-unlock & pid0=$! sleep 1 # passive node -$GETH --cache.preimages --config config01.toml --authrpc.port 8553 --port 64481 --verbosity=3 --syncmode=full --nodiscover --networkid=6448 --datadir=./01/ --unlock 4204477bf7fce868e761caaba991ffc607717dbf --miner.etherbase 4204477bf7fce868e761caaba991ffc607717dbf --password passwordfile --ws --ws.port 8546 --ws.api eth,admin --http --http.api eth,debug,net --http.port 9546 --allow-insecure-unlock & +$GETH --cache.preimages --config config01.toml --authrpc.port 8553 --pprof --pprof.port=6868 --port 64481 --verbosity=3 --syncmode=full --nodiscover --networkid=6448 --datadir=./01/ --unlock 4204477bf7fce868e761caaba991ffc607717dbf --miner.etherbase 4204477bf7fce868e761caaba991ffc607717dbf --password passwordfile --ws --ws.port 8546 --ws.api eth,admin --http --http.api eth,debug,net --http.port 9546 --allow-insecure-unlock & sleep 1 # shutdown node -$GETH --config config02.toml --authrpc.port 8556 --port 64484 --verbosity=0 --syncmode=full --nodiscover --networkid=6448 --datadir=./02/ --unlock 2cb2e3bdb066a83a7f1191eef1697da51793f631 --miner.etherbase 2cb2e3bdb066a83a7f1191eef1697da51793f631 --password passwordfile --ws --ws.port 8548 --ws.api eth,admin --http --http.api eth,debug,net --http.port 9547 --allow-insecure-unlock & +$GETH --config config02.toml --authrpc.port 8556 --pprof --pprof.port=6969 --port 64484 --verbosity=0 --syncmode=full --nodiscover --networkid=6448 --datadir=./02/ --unlock 2cb2e3bdb066a83a7f1191eef1697da51793f631 --miner.etherbase 2cb2e3bdb066a83a7f1191eef1697da51793f631 --password passwordfile --ws --ws.port 8548 --ws.api eth,admin --http --http.api eth,debug,net --http.port 9547 --allow-insecure-unlock & pid1=$! sleep 5 diff --git a/plugins/wrappers/backendwrapper/backendwrapper.go b/plugins/wrappers/backendwrapper/backendwrapper.go index c192559ad..3522ba511 100644 --- a/plugins/wrappers/backendwrapper/backendwrapper.go +++ b/plugins/wrappers/backendwrapper/backendwrapper.go @@ -502,15 +502,15 @@ func (b *Backend) GetTrie(h core.Hash) (core.Trie, error) { } func (b *Backend) GetAccountTrie(stateRoot core.Hash, account core.Address) (core.Trie, error) { - tr, err := b.GetTrie(stateRoot) + tr, err := b.db.OpenTrie(common.Hash(stateRoot)) if err != nil { return nil, err } - act, err := tr.GetAccount(account) + act, err := tr.GetAccount(common.Address(account)) if err != nil { return nil, err } - acTr, err := b.db.OpenStorageTrie(common.Hash(stateRoot), common.Address(account), common.Hash(act.Root)) + acTr, err := b.db.OpenStorageTrie(common.Hash(stateRoot), common.Address(account), common.Hash(act.Root), tr) if err != nil { return nil, err }