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

Upstream merge up to 1.9.16 #1536

Merged
merged 132 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
8523ad4
core: filter out txs with invalid signatures as soon as possible
duanhao0814 Jun 3, 2020
da06519
params: begin v1.9.16 release cycle
fjl Jun 8, 2020
45b7535
cmd/ethkey: support --passwordfile in generate command (#21183)
libby Jun 8, 2020
39abd92
ethstats: use timer instead of time.sleep (#20924)
ucwong Jun 8, 2020
cf66745
core/vm: use uint256 in EVM implementation (#20787)
chfast Jun 8, 2020
80e887d
core/state: avoid escape analysis fault when accessing cached state
karalabe Jun 8, 2020
a0797e3
Merge pull request #21192 from karalabe/fix-escape-analysis
karalabe Jun 8, 2020
d5c267f
accounts/keystore: fix typo in error message (#21200)
p4u Jun 9, 2020
89043cb
accounts/abi: make GetType public again (#21157)
natsukagami Jun 9, 2020
e9ba536
eth/downloader: fix spuriously failing tests (#21149)
holiman Jun 9, 2020
4a19c0e
core, eth, internal: include read storage entries in structlog output…
rjl493456442 Jun 10, 2020
e30c0af
build, internal/ethapi, crypto/bls12381: fix typos (#21210)
howjmay Jun 10, 2020
c85fdb7
go.mod: update uint256 to 1.1.0 (#21206)
holiman Jun 11, 2020
9371b2f
internal/web3ext: add missing params to debug.accountRange (#21208)
hackmod Jun 11, 2020
a981b60
eth/downloader: don't use defer for unlock before return (#21227)
six-days Jun 15, 2020
eb9d7d1
Merge pull request #21170 from duanhao0814/fix-dup-ecrecover
karalabe Jun 16, 2020
bcf19bc
core/rawdb: swap tailId and itemOffset for deleted items in freezer (…
zhangsoledad Jun 17, 2020
56a319b
cmd, eth, internal, les: add txfee cap (#21212)
rjl493456442 Jun 17, 2020
e029cc6
go.mod: update snappy dependency (#21237)
ucwong Jun 18, 2020
5435e0d
whisper : use timer.Ticker instead of sleep (#21240)
ucwong Jun 18, 2020
3ebfeb0
core/rawdb: fix high memory usage in freezer (#21243)
AusIV Jun 19, 2020
9a188c9
common/fdlimit: build on DragonflyBSD (#21241)
gballet Jun 19, 2020
dce533c
whisper: fix time.sleep by time.ticker in whisper_test (#21251)
ucwong Jun 23, 2020
42ccb2f
p2p: measure packet throughput too, not just bandwidth
karalabe Jun 24, 2020
c42d139
Merge pull request #21256 from karalabe/p2p-packet-metrics
karalabe Jun 24, 2020
da180ba
cmd/devp2p: add commands for node key management (#21202)
fjl Jun 24, 2020
23f1a0b
crypto/secp256k1: enable 128-bit int code and endomorphism optimizati…
fjl Jun 24, 2020
93142e5
eth: don't block if transaction broadcast loop fails (#21255)
rjl493456442 Jun 24, 2020
b482423
trie: reduce allocs in insertPreimage (#21261)
MariusVanDerWijden Jun 24, 2020
0c82928
core/vm: fix incorrect computation of BLS discount (#21253)
MariusVanDerWijden Jun 24, 2020
413358a
cmd/geth: make import cmd exit with 1 if import errors occurred (#21244)
meowsbits Jun 24, 2020
02cea23
eth: returned revert reason in traceTx (#21195)
MariusVanDerWijden Jun 26, 2020
c13df14
utils: fix ineffectual miner config flags (#21271)
meowsbits Jun 30, 2020
dd91c7c
cmd: abstract `getPassPhrase` functions into one (#21219)
binacs Jun 30, 2020
e376d2f
cmd/evm: add state transition tool for testing (#20958)
holiman Jun 30, 2020
ddeea1e
core: types: less allocations when hashing and tx handling (#21265)
MariusVanDerWijden Jun 30, 2020
b86b1e6
go.mod: bump gopsutil version (#21275)
gballet Jun 30, 2020
1e635bd
go.mod: updated crypto deps causing build failure (#21276)
renaynay Jun 30, 2020
d671dbd
eth/downloader: fixes data race between synchronize and other methods…
MariusVanDerWijden Jun 30, 2020
ec51cbb
cmd/geth: LES priority client test (#20719)
adamschmideg Jul 1, 2020
8dfd66f
rlp: avoid list header allocation in encoder (#21274)
MariusVanDerWijden Jul 1, 2020
af5c97a
core, txpool: less allocations when handling transactions (#21232)
MariusVanDerWijden Jul 1, 2020
12867d1
rpc, internal/ethapi: default rpc gascap at 25M + better error messag…
holiman Jul 1, 2020
7451fc6
internal/ethapi: default gas to maxgascap, not max int64 (#21284)
holiman Jul 2, 2020
04c4e50
ethapi: don't crash when keystore-specific methods are called but ext…
holiman Jul 2, 2020
07a95ce
les/checkpointoracle: don't lookup checkpoint more than once per minu…
holiman Jul 2, 2020
61270e5
eth/gasprice: lighter gas price oracle for light client (#20409)
rjl493456442 Jul 3, 2020
490b380
cmd/geth: allow configuring metrics HTTP server on separate endpoint …
meowsbits Jul 3, 2020
fa01117
build/ci: handle split up listing (#21293)
holiman Jul 4, 2020
6315b6f
rlp: reduce allocations for big.Int and byte array encoding (#21291)
fjl Jul 6, 2020
6d8e51a
cmd, node: dump empty value config (#21296)
rjl493456442 Jul 6, 2020
e5871b9
cmd/clef: Update README with external v6.0.0 & internal v7.0.1 APIs (…
chris-j-h Jul 7, 2020
6a48ae3
cmd/devp2p: add discv4 test suite (#21163)
adamschmideg Jul 7, 2020
c16967c
cmd/clef: Fix broken link in README and other minor fixes (#21303)
chris-j-h Jul 7, 2020
5b1cfde
eth: increase timeout in TestBroadcastBlock (#21299)
holiman Jul 8, 2020
7a556ab
go.mod: upgrade to github.com/golang/snappy with arm64 asm (#21304)
ucwong Jul 8, 2020
967d8de
eth/downloader: fix peer idleness tracking when restarting state sync…
holiman Jul 8, 2020
bcb3087
Revert "core, txpool: less allocations when handling transactions (#2…
fjl Jul 9, 2020
6ccce09
common/math: use math/bits intrinsics for Safe* (#21316)
fjl Jul 9, 2020
beabf95
cmd/geth, cmd/puppeth: replace deprecated rpc and ws flags in tests a…
renaynay Jul 9, 2020
feb40e3
accounts/external: remove dependency on internal/ethapi (#21319)
rjl493456442 Jul 10, 2020
ea3b00a
params: go-ethereum v1.9.16 stable
fjl Jul 10, 2020
5d4d4e6
Merge commit '8523ad4' into hbandura/merge-upstream-1.9.16
hbandura Apr 22, 2021
dc7a211
Merge commit 'da06519' into hbandura/merge-upstream-1.9.16
hbandura Apr 22, 2021
f0bf283
Merge commit '45b7535' into hbandura/merge-upstream-1.9.16
hbandura Apr 22, 2021
95d6aa4
Merge commit '39abd92' into hbandura/merge-upstream-1.9.16
hbandura Apr 28, 2021
115b6ed
Merge commit 'cf66745' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
000c437
Merge commit '80e887d' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
fc89fa8
Merge commit 'a0797e3' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
ec185e1
Merge commit 'd5c267f' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
1c2dd15
Merge commit '89043cb' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
65d52ae
Remove lint warning
hbandura Apr 29, 2021
8c15109
Merge commit 'e9ba536' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
db3be27
Merge commit '4a19c0e' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
b8c37ca
Merge commit 'e30c0af' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
f1b572d
Merge commit 'c85fdb7' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
f1959a7
Merge commit '9371b2f' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
962203f
Merge commit 'a981b60' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
d4094cf
Merge commit 'eb9d7d1' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
96fbcfa
Merge commit 'bcf19bc' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
e8cbf75
Merge commit '56a319b' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
8644d58
Fix error message
hbandura Apr 29, 2021
815a5c9
Merge commit '5435e0d' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
6eaa509
Merge commit '3ebfeb0' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
23dec81
Merge commit '9a188c9' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
8b1cf76
Merge commit 'dce533c' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
a8f2242
Merge commit '42ccb2f' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
76d8879
Merge commit 'c42d139' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
2ccdcca
Merge commit 'da180ba' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
97a8556
Merge commit '23f1a0b' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
69bf97c
Merge commit '93142e5' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
bcad49c
Merge commit 'b482423' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
11da563
Merge commit '0c82928' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
ea3049f
Merge commit '413358a' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
859bc7f
Merge commit '02cea23' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
c14224e
Merge commit 'c13df14' into hbandura/merge-upstream-1.9.16
hbandura Apr 29, 2021
95097a1
Merge commit 'dd91c7c' into hbandura/merge-upstream-1.9.16
hbandura Apr 30, 2021
fa637ff
Merge commit 'e376d2f' into hbandura/merge-upstream-1.9.16
hbandura Apr 30, 2021
f431aea
Merge commit 'ddeea1e' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
7aa5a35
Merge commit 'b86b1e6' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
b03b296
Merge commit '1e635bd' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
4d97d6f
Merge commit 'd671dbd' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
4073a78
Merge commit 'ec51cbb' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
da3a1de
Merge commit '8dfd66f' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
b38dafb
Skip priority client test
hbandura May 5, 2021
f7bd67f
Merge commit 'af5c97a' into hbandura/merge-upstream-1.9.16
hbandura May 5, 2021
6f4b23f
Merge commit '12867d1' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
84fe03b
Merge commit '7451fc6' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
249e44e
Merge commit '04c4e50' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
5c07222
Merge commit '07a95ce' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
230119d
Merge commit '61270e5' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
7af4144
Merge commit '490b380' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
2aff45f
Merge commit 'fa01117' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
6f94816
Merge commit '6315b6f' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
7f44edf
Merge commit '6d8e51a' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
631a661
Merge commit 'e5871b9' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
07ab6c9
Merge commit '6a48ae3' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
3ecb198
Merge commit 'c16967c' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
e47a24f
Merge commit '5b1cfde' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
30fc32b
Merge commit '7a556ab' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
b45edd4
Merge commit '967d8de' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
d70a7f0
Merge commit 'bcb3087' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
a9a09a2
Merge commit '6ccce09' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
1f93923
Merge commit 'beabf95' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
b3481b4
Merge commit 'feb40e3' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
7694d1e
Merge commit 'ea3b00a' into hbandura/merge-upstream-1.9.16
hbandura May 6, 2021
40ddf14
Add currency comparison when using RPCTxFeeCap in internal/ethapi/api.go
hbandura May 7, 2021
8e59652
Fix flag doc
hbandura May 7, 2021
72a85b7
Change RPCTxFeeCap to celo instead of wei
hbandura May 7, 2021
c0d414b
Merge remote-tracking branch 'origin/master' into hbandura/merge-upst…
hbandura May 10, 2021
79ab857
Fix les priority client test
hbandura Jun 1, 2021
494ffce
Merge remote-tracking branch 'origin/master' into hbandura/merge-upst…
hbandura Jun 1, 2021
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
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ var (
utils.IPCPathFlag,
utils.InsecureUnlockAllowedFlag,
utils.RPCGlobalGasCap,
utils.RPCGlobalTxFeeCap,
}

whisperFlags = []cli.Flag{
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ var AppHelpFlagGroups = []flagGroup{
utils.GraphQLCORSDomainFlag,
utils.GraphQLVirtualHostsFlag,
utils.RPCGlobalGasCap,
utils.RPCGlobalTxFeeCap,
utils.JSpathFlag,
utils.ExecFlag,
utils.PreloadJSFlag,
Expand Down
11 changes: 10 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,11 @@ var (
Name: "rpc.gascap",
Usage: "Sets a cap on gas that can be used in eth_call/estimateGas",
}

RPCGlobalTxFeeCap = cli.Float64Flag{
Name: "rpc.txfeecap",
Usage: "Sets a cap on transaction fee (in celo) that can be sent via the RPC APIs (0 = no cap)",
Value: eth.DefaultConfig.RPCTxFeeCap,
}
// Logging and debug settings

CeloStatsURLFlag = cli.StringFlag{
Expand Down Expand Up @@ -1717,6 +1721,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
if ctx.GlobalIsSet(RPCGlobalGasCap.Name) {
cfg.RPCGasCap = new(big.Int).SetUint64(ctx.GlobalUint64(RPCGlobalGasCap.Name))
}

if ctx.GlobalIsSet(RPCGlobalTxFeeCap.Name) {
cfg.RPCTxFeeCap = ctx.GlobalFloat64(RPCGlobalTxFeeCap.Name)
}

// Disable DNS discovery by default (by using the flag's value even if it hasn't been set and so
// has the default value ""), since we don't have DNS discovery set up for Celo.
// Note that passing --discovery.dns "" is the way the Geth docs specify for disabling DNS discovery,
Expand Down
4 changes: 4 additions & 0 deletions eth/api_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ func (b *EthAPIBackend) RPCGasCap() *big.Int {
return b.eth.config.RPCGasCap
}

func (b *EthAPIBackend) RPCTxFeeCap() float64 {
return b.eth.config.RPCTxFeeCap
}

func (b *EthAPIBackend) BloomStatus() (uint64, uint64) {
sections, _, _ := b.eth.bloomIndexer.Sections()
return params.BloomBitsBlocks, sections
Expand Down
7 changes: 6 additions & 1 deletion eth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ var DefaultConfig = Config{
},
GatewayFee: big.NewInt(0),

TxPool: core.DefaultTxPoolConfig,
TxPool: core.DefaultTxPoolConfig,
RPCTxFeeCap: 1, // 1 celo
hbandura marked this conversation as resolved.
Show resolved Hide resolved

Istanbul: *istanbul.DefaultConfig,
}
Expand Down Expand Up @@ -129,6 +130,10 @@ type Config struct {
// RPCGasCap is the global gas cap for eth-call variants.
RPCGasCap *big.Int `toml:",omitempty"`

// RPCTxFeeCap is the global transaction fee(price * gaslimit) cap for
// send-transction variants. The unit is ether.
RPCTxFeeCap float64 `toml:",omitempty"`

// Checkpoint is a hardcoded checkpoint which can be nil.
Checkpoint *params.TrustedCheckpoint `toml:",omitempty"`

Expand Down
12 changes: 12 additions & 0 deletions eth/gen_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,13 @@ func (args *SendTxArgs) toTransaction() *types.Transaction {

// SubmitTransaction is a helper function that submits tx to txPool and logs a message.
func SubmitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (common.Hash, error) {
// If the transaction fee cap is already specified, ensure the
// fee of the given transaction is _reasonable_.
feeEth := new(big.Float).Quo(new(big.Float).SetInt(new(big.Int).Mul(tx.GasPrice(), new(big.Int).SetUint64(tx.Gas()))), new(big.Float).SetInt(big.NewInt(params.Ether)))
feeFloat, _ := feeEth.Float64()
if b.RPCTxFeeCap() != 0 && feeFloat > b.RPCTxFeeCap() {
return common.Hash{}, fmt.Errorf("tx fee (%.2f ether) exceeds the configured cap (%.2f ether)", feeFloat, b.RPCTxFeeCap())
hbandura marked this conversation as resolved.
Show resolved Hide resolved
}
if err := b.SendTx(ctx, tx); err != nil {
return common.Hash{}, err
}
Expand Down
3 changes: 2 additions & 1 deletion internal/ethapi/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ type Backend interface {
ChainDb() ethdb.Database
AccountManager() *accounts.Manager
ExtRPCEnabled() bool
RPCGasCap() *big.Int // global gas cap for eth_call over rpc: DoS protection
RPCGasCap() *big.Int // global gas cap for eth_call over rpc: DoS protection
RPCTxFeeCap() float64 // global tx fee cap for all transaction related APIs

// Blockchain API
SetHead(number uint64)
Expand Down
4 changes: 4 additions & 0 deletions les/api_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ func (b *LesApiBackend) RPCGasCap() *big.Int {
return b.eth.config.RPCGasCap
}

func (b *LesApiBackend) RPCTxFeeCap() float64 {
return b.eth.config.RPCTxFeeCap
}

func (b *LesApiBackend) BloomStatus() (uint64, uint64) {
if b.eth.bloomIndexer == nil {
return 0, 0
Expand Down