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

Big merge v1.10.16 v1.12.2 #1840

Merged
merged 1,259 commits into from
Sep 14, 2023
Merged

Big merge v1.10.16 v1.12.2 #1840

merged 1,259 commits into from
Sep 14, 2023

Conversation

NathanBSC
Copy link
Contributor

@NathanBSC NathanBSC commented Aug 24, 2023

Description

upstream from go-ethereum [v1.10.16, v1.12.2]

Rationale

import new features, bugfix, code clear up from go-ethereum

Example

  1. make test pass
  2. make truffle-test pass
  3. can work as miner using node-deploy(branch adapt_for_big_merge)
  4. Testnet full sync from genesis to the latest block: passed
  5. full sync mainnet works ( sync 5M blocks for test)
  6. transfer using metamask pass

Changes

RPC

internal/ethapi: add debug_getRawReceipts RPC method (#24773) 
node, rpc: add ReadHeaderTimeout config option (#25338) 
rpc: check that "version" is "2.0" in request objects (#25570) 
rpc: support injecting HTTP headers through context (#26023) 
rpc: websocket should respect the "HTTP_PROXY" by default (#27264)
rpc: change BlockNumber constant values to match ethclient (#27219) 
eth: make debug_StorageRangeAt take a block hash or number (#27328)
eth,core: add api debug_getTrieFlushInterval (#27303) 
rpc: add limit for batch request items and response size (#26681) 
core/types: support yParity field in JSON transactions (#27744) 
eth/filters: send rpctransactions in pending-subscription (#26126) 

Flag

cmd/geth: rename --whitelist to --eth.requiredblocks (#24505) 
cmd: migrate to urfave/cli/v2 (#24751) 
cmd/utils: print warning when --metrics.port set without --metrics.ad…
cmd/devp2p: add --extaddr flag (#26312)
core,eth: add debug_setTrieFlushInterval to change trie flush frequ
miner, cmd, eth: require explicit etherbase address (#26413)
cmd/geth: Add --log.format cli param (#27001) 
cmd/geth: rename --vmodule to --log.vmodule (#27071) 
params, trie: add verkle fork management + upgrade go-verkle (#27464)

GraphQL

graphql: fee history fields (#24452)
graphql: add rawReceipt field to transaction type (#24738) 
graphql: add raw fields to block and tx (#24816)
graphql: return correct logs for tx (#25612)
graphql: add query timeout (#26116) 
graphql, node, rpc: improve HTTP write timeout handling (#25457) 
graphql: implement withdrawals (EIP-4895) (#27072) 

Client

ethclient: add CallContractAtHash (#24355)
ethclient: add PeerCount method (#24849) 
ethereum, ethclient: add FeeHistory support (#25403)
eth/filters, ethclient/gethclient: add fullTx option to pending tx fi…
ethclient: include withdrawals in ethclient block responses (#26778) 

Tracer

eth/tracers/js: drop duktape engine (#24934) 
eth/tracers: add support for block overrides in debug_traceCall (#24871)
eth/tracers: add onlyTopCall option to callTracer (#25430)
eth/tracers: remove revertReasonTracer, add revert reason to callTracer
eth/tracers: add diffMode to prestateTracer (#25422)
eth/tracers: add multiplexing tracer (#26086)
core/vm: set tracer-observable value of a delegatecall to match parent value
eth/tracers: add native flatCallTracer (aka parity style tracer) (#26…
eth/tracers/native: set created address to nil in case of failure (#2…
eth/tracers: report correct gasLimit in call tracers (#27029)
eth/tracers: add txHash field on txTraceResult (#27183)
eth/tracers: add ReturnData in the tracer's response (#27704)

Command

cmd/geth: inspect snapshot dangling storage (#24643)
core/state/snapshot: detect and clean up dangling storage snapshot in generation
internal/ethapi: add db operations to api (#24739)
cmd/geth: add db check-state-content to verify integrity of trie nodes (#24840)
ethdb/remotedb, cmd: add support for remote (readonly) databases
cmd/abigen: accept combined-json via stdin (#24960)
cmd/geth: extend traverseRawState command (#24954)
cmd/geth, core/state/snapshot: rework journal loading, implement account-check (#24765)
cmd/geth: add a verkle subcommand (#25718) 
cmd/geth, cmd/utils: geth attach with custom headers (#25829) 
core/rawdb: refactor db inspector for extending multiple ancient storage
cmd/clef: add list-accounts and list-wallets to CLI (#26080)
cmd/clef: add importraw feature to clef (#26058)
cmd/devp2p: add more nodekey commands (#26129) 
internal/web3ext: fix eth_call stateOverrides in console (#26265) 
cmd/evm: add blocktest subcommand to evm (#26526) 

HardFork

params: define cancun and prague as timestamp based forks (#26481) 
all: tie timestamp based forks to the passage of London (#27279)

Shanghai

core/vm: implement EIP-3855: PUSH0 instruction (#24039)
core: implement EIP-3651, warm coinbase (#25819) 
core/vm: implement EIP-3860: Limit and meter initcode (#23847)
all: implement withdrawals (EIP-4895) (#26484) 

CanCun (almost ready)

all: implement EIP-1153 transient storage (#26003) 
core: 4844 opcode and precompile (#27356) 
core/vm: implement EIP-5656, mcopy instruction (#26181) 
core/state, core/vm: implement EIP 6780 (#27189) 

New Feature

eth: introduce eth67 protocol (#24093) 
eth: implement eth/68 (#25980) 
PBBS(ready to activate)
https://github.com/ethereum/go-ethereum/commits?author=rjl493456442

P2P

eth/fetcher: throttle peers which deliver many invalid transactions (…

Build

build/bot: add ppa-build.sh (#24919)
more checs in ci

Improvement

all: use 'embed' instead of go-bindata (#24744)
all: move genesis initialization to blockchain (#25523)

Clear Up

common/compiler, cmd/abigen: remove solc/vyper compiler integration
all: remove concept of public/private API definitions (#25053)
cmd/geth: drop geth js command (#25000) 
core/genesis: remove calaverasAllocData (#25516)
node: drop support for static & trusted node list files (#25610)
core: drop legacy receipt types (#26225) 
cmd/puppeth: remove puppeth
cmd, eth, node: deprecate personal namespace (#26390) 
accounts, build, mobile: remove Andriod and iOS support
params: remove EIP150Hash from chainconfig (#27087) 
all: remove notion of trusted checkpoints in the post-merge world (#2…
all: remove ethash pow, only retain shims needed for consensus and te
cmd, core, eth, graphql, trie: no persisted clean trie cache file (#2…
les: remove obsolete code related to PoW header syncing (#27737) 
remove diffsync

Others

accounts/usbwallet: support Ledger Nano S Plus and FTS (#25933) 
accounts/scwallet: fix keycard data signing error (#25331)
core/state: replace fastcache code cache with gc-friendly structure (…
internal/debug: add --log.file option (#26149)
ci: disable coverage reporting in appveyor and travis
all: change chain head markers from block to header (#26777)
core, miner: revert block gas counter in case of invalid transaction
accounts/usbwallet: mitigate ledger app chunking issue (#26773) 
signer/core: accept all solidity primitive types for EIP-712 signing
cmd/geth: enable log rotation (#26843) 
internal/ethapi: make EstimateGas use latest block by default (#24363) 
miner: suspend miner if node is syncing (#27218) 
all: move main transaction pool into a subpool (#27463) 
core/txpool/blobpool: 4844 blob transaction pool (#26940)
eth: send big transactions by announce/retrieve only (#27618) 
core/rawdb: support freezer batch read with no size limit (#27687)
disable pipeCommit, break now

ucwong and others added 30 commits May 2, 2023 04:32
Fixes a discrepancy between source and generated files, which was introduced when ExcessDataGas was added in ethereum/go-ethereum#27046.
* ✏️ Fix typos

* ⏪️ Revert changes

* Update internal/web3ext/web3ext.go

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
…r (#26999)

This adds logic to prepend 'M' or 'E' to Solidity identifiers when they would
otherwise violate Go identifier naming rules.

Closes #26972

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
…sts (#27178)

* all: remove ethash pow, only retain shims needed for consensus and tests

* all: thank you linter

* all: disallow launching Geth in legacy PoW mode

* cmd/env/internal/t8ntool: remove dangling ethash flag
rpc: use atomic type
This PR modifies the interface for the results of `debug_traceBlock` and `debug_traceCall` by adding the `txHash`, allowing users to identify which transaction's trace result corresponds to. 

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
* core/state : fix map size avoid resizing

* core/state : fixed size
rename parameter

In this case, the naming of "extapi" might create some confusion. Although it represents an External Signer Backend, its name could be mistaken for an API. In reality, it is a backend instance used for communicating with external signers. A better naming choice could be "extBackend" or "externalBackend" to more accurately describe that it is a backend instance rather than an API.
* log/format.go : invalid string cast fix

* log: some polish

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
* all: port boring changes from pbss

* core, trie: address comments from martin

* trie: minor fixes

* core/rawdb: update comment

* core, eth, tests, trie: address comments

* tests, trie: add extra check when update trie database

* trie/triedb/hashdb: degrade the error to warning
* miner : initialize maps with known size

* miner:some reverts
When block import fails, the error displays the number of the first block past the import batch, not the number of the failing block. This change fixes this problem by identifying which blocks fails and reporting its number.
event: initialize maps with known size
* cryto/kzg4844: pull in the C and Go libs for KZG cryptography

* go.mod: pull in the KZG libraries

* crypto/kzg4844: add basic becnhmarks for ballpark numbers

* cmd, crypto: integrate both CKZG and GoKZG all the time, add flag

* cmd/utils, crypto/kzg4844: run library init on startup

* crypto/kzg4844: make linter happy

* crypto/kzg4844: push missing file

* crypto/kzg4844: fully disable CKZG but leave in the sources

* build, crypto/kzg4844, internal: link CKZG by default and with portable mode

* crypto/kzg4844: drop verifying the trusted setup in gokzg

* internal/build: yolo until it works?

* cmd/utils: make flag description friendlier

Co-authored-by: Martin Holst Swende <martin@swende.se>

* crypto/ckzg: no need for double availability check

* build: tiny flag cleanup nitpick

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Signed-off-by: jsvisa <delweng@gmail.com>
* EstimateGas should use LatestBlockNumber by default

* graphql: default to use latest for gas estimation

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
rpc: the default dialer for websocket should respect the proxy environment variables like "HTTP_PROXY"
dependabot bot and others added 9 commits August 12, 2023 00:18
build(deps): bump github.com/supranational/blst

Bumps [github.com/supranational/blst](https://github.com/supranational/blst) from 0.3.11-0.20230406105308-e9dfc5ee724b to 0.3.11.
- [Release notes](https://github.com/supranational/blst/releases)
- [Commits](https://github.com/supranational/blst/commits/v0.3.11)

---
updated-dependencies:
- dependency-name: github.com/supranational/blst
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The Go authors updated golang/x/ext to change the function signature of the slices sort method. 
It's an entire shitshow now because x/ext is not tagged, so everyone's codebase just 
picked a new version that some other dep depends on, causing our code to fail building.

This PR updates the dep on our code too and does all the refactorings to follow upstream...
This upgrades to the latest release of ckzg, and also attempts to fix some blst-related
build errors that occur on launchpad.net.
@NathanBSC NathanBSC marked this pull request as draft August 24, 2023 09:35
* fix: crash of highestVerifiedHeader

* fix: panic of blobpool

* fix: genesis set up

* 1. modify NewDatabaseWithNodeDB to upstream
2. fix race use of hasher in statedb
3. fix use wrong value when updateTrie

* fix dir legacypool

* fix dir blobpool

* fix dir vote

* remove diffsync related code

* fix core/state/snapshot

* disable pipeCommit for now

* fix applyTransaction for bloom setting

* CI: fast finality in gasprice test

* CI: diffFetcher was removed

* CI: downloader, remove beaconsync test

* CI: no beaconsync in downloader, remove a failed case

TestCheckpointChallenge was removed in:
ethereum/go-ethereum#27147
since after merge, it is useless for ethereum, but might be useful for BSC.
disable the case right now, as it is not a big issue.

* CI: bsc protocol decHandlers

* CI: receipt Bloom process

* 1. skip CheckConfigForkOrder for non-parlia engine
2. all test cases in core work well now
	cd core && go test ./... -v

* fix test cases in trie dir

* CI: no beaconsync in downloader, remove a failed case(redo)

* fix dir miner

* fix dir cmd/geth

* CI: filter test, BaseFee & Finality

* fix dir graphql

* remove diffStore

* fix ethclient

* fix TestRPCGetTransactionReceipt

* fix dir internal

* ut add dir ethstats and signer

* disable pipeCommit thoroughly; fix concurrent map iteration and map write in statedb

* CI: fix snap sync

it could be changed by mistake

* fix tests/Run to generate snapshot

* prepare for merge

* remove useless

* use common hasher in getDeletedStateObject, no race here

* an critical comment for state.Prepare

* do not copy nil accessList

* add omitempty tag for unused new fields of core.Genesis

* remove totalFees

* calculate fees before FinalizeAndAssemble

* revert interface Finalize of consensus

* do not double gas limit upon london block

* use Leveldb as default

* Revert "remove diffStore"

This reverts commit df343b1.

* Revert "remove diffsync related code"

This reverts commit 8d84b81.

* compile pass after revert

* remove diffsync

* fix dir eth/protocols/trust

* fix TestFastNode

* decHandlers for trust protocol

* keep persist diff in test
@buddh0 buddh0 marked this pull request as ready for review September 7, 2023 08:40
Copy link
Collaborator

@brilliant-lx brilliant-lx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a huge PR, unable to go through the details, I went through most of the files and mainly checked the code I am familiar with and important to me.

Here are the modules that I specially checked: parlia, statedb, evm, downloader, miner

Some of the modules that have huge changes, we need to especially take care of in the future, include but not limit to: trie, txpool, p2p, rpc, prune, database...

And I also have tried to test the full sync capability in AWS:

  • Testnet Full Sync: succeed to sync from genesis to the latest block
  • Mainnet Full Sync: succeed to sync from genesis for several million blocks,
  • Mainnet Full Sync: succeed to sync based on a recent snapshot to catch to the latest blocks

So I would give a approve and we can move on to run more test cases and make it stable.

Copy link

@RenRick RenRick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.