13 #1
Labels
bug
Something isn't working
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
wontfix
This will not be worked on
Description
Upgrade to go-ethereum 1.10.3.
Changes
Snapshots
Snapshots are an acceleration data structure on top of the Ethereum state, that allows reading accounts and contract storage significantly faster. The snapshot feature reduces the cost of accessing an account from O(logN) to O(1).
Though snapshots have enormous benefits, there are certain costs to them:
A snapshot is a redundant copy of the raw Ethereum state already contained in the leaves of the Merkle Patricia trie so it requires an additional disk overhead.
Since nobody has snapshots constructed in the network yet, nodes will initially need to bear the cost of iterating the state trie and creating the initial snapshot themselves. This might take a day to a week but you only need to do it once in the lifetime of your node.
Snapshot feature is enabled by default, you can disable it via
--snapshot=false
.Snap sync
Now you have two different ways to synchronize the BSC network: full sync and fast sync. Full sync operated by downloading the entire chain and executing all transactions; fast sync placed an initial trust in a recent-ish block, and directly downloaded the state associated with it (after which it switched to block execution like full sync).
For fast sync, it needs to download the trie nodes one by one. So it will take time to download all the nodes if there are millions of nodes. And for the serving peers, they need to traverse all the nodes and it also takes time.
Snap sync is designed to solve the fast sync problems. The core idea is instead of downloading the trie node-by-node, snap sync downloads the contiguous chunks of useful state data, and reconstructs the Merkle trie locally.
You can manually enable snap sync via
--syncmode=snap
. Note: usually it will need one or two weeks until there is enough client upgrade to the version with snap enabled, you may use snap sync after that.Offline pruning
If you have snapshots enabled and fully generated, Geth can use those as an acceleration structure to relatively quickly determine which trie nodes should be kept and which should be deleted. Pruning trie nodes based on snapshots does have the drawback that the chain may not progress during pruning. This means that you need to stop Geth, prune its database and then restart it.
Execution time wise, pruning takes a few hours (greatly depends on your disk speed and accumulated junk), one third of which is indexing recent trie nodes from snapshots, one third deleting stale trie nodes and the last third compacting the database to reclaim freed up space. At the end of the process, your disk usage should approximately be the same as if you did a fresh sync.
To prune your database, please run
geth snapshot prune-state
.Note: You need to upgrade the client and run for a while before prune the data
Transaction unindexing
Geth no longer keeps transaction inclusion info for all transactions, and instead limits the storage of inclusion records to one year. For application developers, this change means that very old transactions can no longer be accessed by hash.
If you would like todisable this behavior and keep inclusion information for all historical transactions, you can re-enable indexing using the
--txlookuplimit=0
command-line flag.Database changes
There is an incompatible database change: adds a prefix for contract code in order to separate the codes and trie nodes.
So if you use the version of geth, you will not be able to rollback to the older version geth.
Geth command changes
For more details about the command changes, you can refer to: v1.10.0.
Rpc changes
BREAKING CHANGE: Non-EIP155 transactions (i.e. transactions which are not replay-protected) are now rejected by the RPC API. You can disable this restriction using the
--rpc.allow-unprotected-txs
command-line flag.Since there are txs signed by old clients, we need to add this flag for all our nodes.
Response changes in
eth_estimateGas
,eth_call
,eth_sendRawTransaction
.The response will now add a message field in addition to the data field if these RPCs cause the EVM to execute a REVERT operation. For example:
Response changes in
eth_getTransactionByBlockHashAndIndex
,eth_getTransactionByBlockNumberAndIndex
,eth_getTransactionByHash
.The response now adds a type field to denote the transaction type. For example:
GraphQL changes
The GraphQL API is no longer available separately from the JSON-RPC HTTP server. If you want GraphQL, you need to enable it using the
--http --graphql
flag combination. The--graphql.port
and--graphql.addr
flags are no longer available.Config changes
Remove whisper config.
Remove GraphQL config.
Rename
DiscoveryURLs
toEthDiscoveryURLs
.For more details about config changes, you can refer to go-ethereum v1.9.19, v1.9.21, v1.10.0
Preflight checks
make build
)make test
)Originally posted by @yutianwu in bnb-chain/bsc#152
The text was updated successfully, but these errors were encountered: