* remove rpc flags
* remove legacy rpc flags
* remove legacy rpc flags
* remove legacy rpc commands
* (hopefully) fix most of the build errors
* fix build errors
https://app.travis-ci.com/github/ethereum/go-ethereum/jobs/530318686
* cmd/utils: fix syntax error
* empty commit to unbreak travis ci
* fix syntax error
* syntax fixes
* syntax fixes
* fix
fixes "cmd/geth/usage.go:234:7: expected '(', found init (typecheck)"
* fix
* various fixes in usage.go
* various fixes in flags.go
* adds extra space
reverts the spacing to how it was before I resolved the merge conflict
* more fixes in usage.go
* fix
fix for cmd/geth/usage.go:243:17: expected operand, found ':=' (typecheck) in travis
* Update cmd/utils/flags.go
Co-authored-by: Martin Holst Swende <martin@swende.se>
* fix error
fixes these errors:
cmd/utils/flags_legacy.go:21:2: "strings" imported but not used (typecheck)
"strings"
^
cmd/utils/flags_legacy.go:24:2: "github.com/ethereum/go-ethereum/node" imported but not used (typecheck)
"github.com/ethereum/go-ethereum/node"
^
* goimports
Co-authored-by: Martin Holst Swende <martin@swende.se>
* internal/debug: remove deprecated flags
The removed flags are removed in the main portion of geth, this removes it internally too.
* internal/debug: remove legacy --debug and legacy --backtrace flag
* Update flags.go
Co-authored-by: Martin Holst Swende <martin@swende.se>
Currently, setDefaults overwrites the transaction input value if only input is provided. This causes personal_sendTransaction to estimate the gas based on a transaction with empty data. eth_estimateGas never calls setDefaults so it was unaffected by this.
Currently rpc.BlockNumber is marshalled to JSON as a numeric value, which is
wrong because BlockNumber.UnmarshalJSON() wants it to either be hex-encoded
or string "earliest"/"latest"/"pending". As a result, the call chain
rpc.BlockNumberOrHashWithNumber(123) -> json.Marshal() -> json.Unmarshal()
fails with error "cannot unmarshal object into Go value of type string".
As per benchmark results below, these changes speed up encoding/decoding of
consensus objects a bit.
name old time/op new time/op delta
EncodeRLP/legacy-header-8 384ns ± 1% 331ns ± 3% -13.83% (p=0.000 n=7+8)
EncodeRLP/london-header-8 411ns ± 1% 359ns ± 2% -12.53% (p=0.000 n=8+8)
EncodeRLP/receipt-for-storage-8 251ns ± 0% 239ns ± 0% -4.97% (p=0.000 n=8+8)
EncodeRLP/receipt-full-8 319ns ± 0% 300ns ± 0% -5.89% (p=0.000 n=8+7)
EncodeRLP/legacy-transaction-8 389ns ± 1% 387ns ± 1% ~ (p=0.099 n=8+8)
EncodeRLP/access-transaction-8 607ns ± 0% 581ns ± 0% -4.26% (p=0.000 n=8+8)
EncodeRLP/1559-transaction-8 627ns ± 0% 606ns ± 1% -3.44% (p=0.000 n=8+8)
DecodeRLP/legacy-header-8 831ns ± 1% 813ns ± 1% -2.20% (p=0.000 n=8+8)
DecodeRLP/london-header-8 824ns ± 0% 804ns ± 1% -2.44% (p=0.000 n=8+7)
* rlp: pass length to byteArrayBytes
This makes it possible to inline byteArrayBytes. For arrays, the length is known
at encoder construction time, so the call to v.Len() can be avoided.
* rlp: avoid IsNil for pointer encoding
It's actually cheaper to use Elem first, because it performs less checks
on the value. If the pointer was nil, the result of Elem is 'invalid'.
* rlp: minor optimizations for slice/array encoding
For empty slices/arrays, we can avoid storing a list header entry in the
encoder buffer. Also avoid doing the tail check at encoding time because
it is already known at encoder construction time.
This PR adds functionality to the evm t8n to calculate ethash difficulty. If the caller does not provide a currentDifficulty, but instead provides the parentTimestamp (well, semi-optional, will default to 0 if not given), and parentDifficulty, we can calculate it for him.
The caller can also provide a parentUncleHash. In most, but not all cases, the parent uncle hash also affects the formula. If no such hash is provided (or, if the empty all-zero hash is provided), it's assumed that there were no uncles.
The new linter version is built with go 1.17 and thus includes the go vet
check for mismatched +build and go:build lines.
Fortunately, no new warnings are reported with this update.
In p2p/dial.go, conn.flags was accessed without using sync/atomic.
This race is fixed by removing the access.
In p2p/enode/iter_test.go, a similar race is resolved by writing the field atomically.
Co-authored-by: Felix Lange <fjl@twurst.com>