Skip to content

Supply live tracer #21

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

Closed
wants to merge 188 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
b20caf4
rename constant in comment
ziogaschr Jan 9, 2024
ecbd7fd
add BalanceChangeReason.String() for logging on development
ziogaschr Jan 9, 2024
cae888d
add supply live tracer (draft)
ziogaschr Jan 9, 2024
2e344c8
simplify output
ziogaschr Jan 12, 2024
ee962ac
TODO comment
ziogaschr Jan 16, 2024
7da415f
Add test for supply live tracer
ziogaschr Jan 16, 2024
21dbbf6
Merge branch 'extended-tracer' into extended-tracer-chris
ziogaschr Jan 17, 2024
67adbdc
/s/BalanceChangeWithdrawal/BalanceIncreaseWithdrawal/
ziogaschr Jan 17, 2024
86d0f68
fix Supply does not implement core.BlockchainLogger
ziogaschr Jan 17, 2024
d6d45e5
Refactor supply live tracer tests
ziogaschr Jan 17, 2024
1ba6b06
add test for selfdestruct
ziogaschr Jan 19, 2024
ac2c13d
add supply tracer test where selfdestruct passes funds to itself
ziogaschr Jan 19, 2024
42f6d8b
Count burned amount for selfdestructing contracts
ziogaschr Jan 30, 2024
694c51d
remove obsolete test
ziogaschr Jan 30, 2024
f78f7f7
s/funds/eth1
ziogaschr Feb 1, 2024
a31b05c
remove TODO comment
ziogaschr Feb 1, 2024
50ee919
stop handling BalanceChangeReason.BalanceIncreaseGenesisBalance
ziogaschr Feb 1, 2024
ecca9df
provide contracts code for TestSupplySelfdestructItselfAndRevert
ziogaschr Feb 1, 2024
fcf0042
add “—vmtrace.output.path” for setting the output path for traces
ziogaschr Feb 2, 2024
20cb1eb
fix misspell
ziogaschr Feb 2, 2024
77c987d
remove debug logs
ziogaschr Feb 2, 2024
fcc09ed
Merge branch 'extended-tracer' into extended-tracer-chris
ziogaschr Feb 9, 2024
4608acb
fix live package import issues
ziogaschr Feb 12, 2024
810801c
Revert "add “—vmtrace.output.path” for setting the output path for tr…
ziogaschr Feb 15, 2024
77fec21
Merge branch 'extended-tracer' into extended-tracer-chris
ziogaschr Feb 15, 2024
27bc391
parse lumberjack settings from `—vmtrace.config`
ziogaschr Feb 15, 2024
4dff9da
remove unneeded hasGenesisProcessed
ziogaschr Feb 15, 2024
5009590
use struct for tracing events
s1na Feb 16, 2024
8997f51
Merge branch 'extended-tracer' into extended-tracer-struct
s1na Feb 16, 2024
593e303
core/txpool, eth, miner: pre-filter dynamic fees during pending tx re…
karalabe Feb 17, 2024
034bc46
ethstats: prevent panic if head block is not available (#29020)
rjl493456442 Feb 19, 2024
5d98479
core: using math.MaxUint64 instead of 0xffffffffffffffff (#29022)
cuiweixie Feb 19, 2024
6fb0d09
core/txpool, miner: speed up blob pool pending retrievals (#29008)
karalabe Feb 19, 2024
ac0ff04
core/vm, params: ensure order of forks, prevent overflow (#29023)
holiman Feb 19, 2024
f4852b8
core/txpool, eth, miner: retrieve plain and blob txs separately (#29026)
karalabe Feb 20, 2024
7f5e96d
core/txpool: fix typo (#29031)
buddh0 Feb 20, 2024
bba3fa9
core,eth,internal: fix typo (#29024)
buddh0 Feb 20, 2024
79e340f
params: add cancun upgrade banner (#29042)
tmelhao Feb 21, 2024
b9ca38b
core/txpool: fix typo (#29036)
colinlyguo Feb 21, 2024
b47cf8f
internal/ethapi: fix defaults for blob fields (#29037)
s1na Feb 21, 2024
3b4ede7
params: release go-ethereum v1.13.13 stable
fjl Feb 21, 2024
b590cae
params: begin v1.13.14 release cycle
fjl Feb 21, 2024
fc35780
full struct-based tracing infra
s1na Feb 21, 2024
f434c8d
Add canceler interface
s1na Feb 21, 2024
e47a7c2
internal/ethapi: use overriden baseFee for gasPrice (#29051)
ArtificialPB Feb 22, 2024
b87b9b4
internal/ethapi:fix zero rpc gas cap in eth_createAccessList (#28846)
colinlyguo Feb 22, 2024
93c541a
eth/catalyst: fix wrong error message of payloadV2 after cancun (#29049)
tmelhao Feb 23, 2024
32d4d6e
core/txpool: reject blob txs with blob fee cap below the minimum (#29…
Feb 26, 2024
26724fc
p2p, log, rpc: use errors.New to replace fmt.Errorf with no parameter…
0x2d3c Feb 26, 2024
edffacc
eth/catalyst: enable some commented-out testcases   (#29073)
cuiweixie Feb 26, 2024
8bca93e
internal/ethapi: pass blob hashes to gas estimation (#29085)
mask-pp Feb 26, 2024
821d702
cmd/clef: add spaces in README.md table (#29077)
justindhillon Feb 26, 2024
c1f59b9
eth/catalyst: remove variable in tx conversion loop (#29076)
cuiweixie Feb 26, 2024
63aaac8
core/txpool/blobpool: reduce default database cap for rollout (#29090)
karalabe Feb 26, 2024
45a272c
core/txpool: no need to log loud rotate if no local txs (#29083)
jsvisa Feb 26, 2024
5a0f468
eth/tracers: Fix callTracer logs on onlyTopCall == true (#29068)
andreisilviudragnea Feb 27, 2024
51b479e
core/txpool: elevate the 'already reserved' error into a constant (#2…
Feb 27, 2024
9038ba6
params: release Geth v1.13.14
karalabe Feb 27, 2024
57d2b55
params: begin v1.13.15 cycle
karalabe Feb 27, 2024
22234e9
fix memory copy util func
s1na Feb 27, 2024
60c29ac
fix goja scope object wrappers
s1na Feb 27, 2024
a1877ab
fixes, rm t8ntool tracewriter
s1na Feb 27, 2024
02d77c9
core: using math.MaxUint64 instead of 0xffffffffffffffff (#29094)
cuiweixie Feb 28, 2024
170fcd8
params: being major version bump cycle
karalabe Feb 28, 2024
49623bd
core, triedb/pathdb: calculate the size for batch pre-allocation (#29…
rjl493456442 Feb 28, 2024
5bae14f
triedb/pathdb: fix panic in recoverable (#29107)
rjl493456442 Feb 28, 2024
9986a69
internal/ethapi: pass in accesslist in test (#29089)
buddh0 Feb 28, 2024
8cc747f
moaar fixes
s1na Feb 28, 2024
d65bad2
renaming GetLogger
s1na Feb 28, 2024
7d8db9b
move logger interface to core/tracing
s1na Feb 28, 2024
a2829c6
rename LiveLogger to hooks
s1na Feb 28, 2024
507c072
rename GetLogger to Hooks
s1na Feb 28, 2024
1883438
eth/catalyst: return invalid payload attributes instead of invalid pa…
lightclient Feb 28, 2024
dbc27a1
all: fix function names in docs (#29128)
cuishuang Feb 29, 2024
28d5521
cmd/geth: parseDumpConfig should not return closed db (#29100)
weiihann Feb 29, 2024
db4cf69
all: replace fmt.Errorf() with errors.New() if no param required (#29…
Feb 29, 2024
865e1e9
cmd/utils, core/rawdb, triedb/pathdb: flip hash to path scheme (#29108)
karalabe Feb 29, 2024
0a2f339
eth/catalyst: update simulated beacon for cancun (#28829)
s1na Feb 29, 2024
f358e57
rename scopeContext to opContext
s1na Feb 29, 2024
021d6a4
assign const values for gas change reasons
s1na Feb 29, 2024
ad7b9e8
a type for each hook
s1na Feb 29, 2024
d10d4b7
rm old logger file
s1na Feb 29, 2024
923c180
rename Capture hooks to On
s1na Feb 29, 2024
0b1438c
eth: make transaction propagation paths in the network deterministic …
karalabe Mar 2, 2024
00905f7
all: remove redundant import aliases (#29144)
undefinedor Mar 2, 2024
a732ad0
p2p: remove unused argument 'flags' (#29132)
yasyzb Mar 4, 2024
b408b3e
accounts/abi: delete duplicate error check (#29136)
yasyzb Mar 4, 2024
5a1e8a6
core: delete unused ErrMaxInitCodeSizeExceeded (#29062)
cuiweixie Mar 4, 2024
679a27a
all: use EmptyUncleHash, EmptyCodeHash instead of raw value (#29134)
buddh0 Mar 4, 2024
35cebc1
triedb/pathdb: changed the test code to check for verifying state (#2…
psogv0308 Mar 4, 2024
a97d622
cmd/devp2p: fix commandHasFlag (#29091)
fjl Mar 4, 2024
ca473b8
core: use finalized block as the chain freeze indicator (#28683)
rjl493456442 Mar 4, 2024
19607d1
eth/tracers: Fix prestateTracer pre nonce on contract creation (#29099)
andreisilviudragnea Mar 4, 2024
5d5b384
.mailmap: remove invalid email address (#29163)
reductionista Mar 4, 2024
9b3ceb2
core/types: reuse signtx (#29152)
vieyang Mar 5, 2024
d89d7eb
core: initialize `gasRemaining` with `=` instead of `+=` (#29149)
zhiqiangxu Mar 5, 2024
e199319
rlp: remove a moot todo (#29154)
buddh0 Mar 5, 2024
7b81cf6
core/state, trie/triedb/pathdb: remove storage incomplete flag (#28940)
rjl493456442 Mar 5, 2024
96bf23f
accounts/usbwallet: use updated hid (only) library (#28945)
holiman Mar 5, 2024
dfa6c5e
internal/jsre: format blob fields from hexdecimal to int (#29166)
jsvisa Mar 5, 2024
a6d6e8a
rpc: remove deprecated method "Notifier.Closed" (#29162)
undefinedor Mar 5, 2024
a970295
rlp: using unsafe.Slice instead of SliceHeader (#29067)
cuiweixie Mar 5, 2024
9e129ef
core: remove useless assignments (#29065)
zhiqiangxu Mar 5, 2024
9a0fa80
node: remove test which doesn't do a lot (#29159)
MariusVanDerWijden Mar 5, 2024
f4d5313
consensus, cmd, core, eth: remove support for non-merge mode of opera…
karalabe Mar 5, 2024
66e1a6e
go.mod: bump pebble db to official release (#29038)
Mar 5, 2024
588c548
internal/ethapi: delete needless error check (#29127)
tomdever Mar 6, 2024
899bb88
accounts/usbwallet: revert #28945 (#29175)
holiman Mar 6, 2024
a000acb
rpc: add more test cases for arg types (#29006)
AyumuKasuga Mar 6, 2024
e73f553
accounts/usbwallet: update hid library (#29176)
holiman Mar 6, 2024
a90fe84
accounts: remove deprecated function NewPlaintextKeyStore (#29171)
undefinedor Mar 6, 2024
6e379b6
eth/tracers: prestate tracer add blob fee (#29168)
jsvisa Mar 6, 2024
d8e0807
miner: refactor the miner, make the pending block on demand (#28623)
MariusVanDerWijden Mar 6, 2024
37ce159
rm OnStart and onEnd
s1na Mar 6, 2024
8b3cdda
rename tracer methods to On pattern
s1na Mar 6, 2024
73595f0
rm embedding of noop tracer
s1na Mar 6, 2024
1d01019
rm OnKeccakPreimage
s1na Mar 6, 2024
aadcb88
cmd/blsync, beacon/light: beacon chain light client (#28822)
zsfelfoldi Mar 6, 2024
1d2af89
fix eth config
s1na Mar 6, 2024
935ff70
replace opcode with byte
s1na Mar 7, 2024
5bdbf07
add fn refundGas
s1na Mar 7, 2024
eeb0a46
rm canceler
s1na Mar 7, 2024
3bebabb
accounts: remove redundant string conversion (#29184)
cuinix Mar 7, 2024
cd49060
all: fix typos in comments (#29186)
hyhnet Mar 7, 2024
c41105c
log: add Handler getter to Logger interface (#28793)
sebastianst Mar 7, 2024
d35c8f0
ethclient/gethclient: add blob transaction fields in toCallArg (#29198)
colinlyguo Mar 8, 2024
e31709d
console: fix the wrong error msg of datadir testcase (#29183)
tmelhao Mar 8, 2024
3dc549b
p2p/simulations/adapters: fix error messages in TestTCPPipeBidirectio…
keroro520 Mar 10, 2024
b393ad8
cmd, core, metrics: always report expensive metrics (#29191)
karalabe Mar 11, 2024
00c2112
core/txpool/blobpool: return ErrAlreadyKnown for duplicate txs (#29210)
PlasmaPower Mar 11, 2024
fa4ade8
core: fix deprecation comment for GenesisAccount (#29218)
s1na Mar 11, 2024
ebf9e11
beacon/light/request: fix typos (#29216)
testwill Mar 11, 2024
4e1116f
crypto/bn256/cloudflare: fix noescape-directive (#29222)
kumakichi Mar 12, 2024
89cefe2
cmd: use package filepath over path for file system operations (#29227)
songzhibin97 Mar 12, 2024
99bbbc0
internal/build, rpc: add missing HTTP response body Close() calls (#2…
wzshiming Mar 12, 2024
4bd55a0
common/math: copy result in Exp (#29233)
AaronChen0 Mar 12, 2024
6c76b81
miner: add additional log (#29193)
MariusVanDerWijden Mar 12, 2024
73ca96b
resolve merge conflict
s1na Mar 12, 2024
758fce7
p2p: fix race in dialScheduler (#29235)
fjl Mar 12, 2024
eff424c
eth/tracers: fix concurrency issue for JS-tracing a block (#29238)
s1na Mar 13, 2024
d5bacfa
crypto/kz4844: pass blobs by ref (#29050)
holiman Mar 13, 2024
b80643b
accounts/usbwallet, common/bitutil: fix broken links in docs (#29078)
justindhillon Mar 13, 2024
c170fa2
core: improve chain rewinding mechanism (#29196)
rjl493456442 Mar 13, 2024
65bdbc1
fix lint issue
s1na Mar 13, 2024
0b5975f
fix merge conflict
s1na Mar 13, 2024
b71dc65
fix merge conflict
s1na Mar 13, 2024
eb3f145
update supply tracer to new interface
s1na Mar 13, 2024
153f04a
rm captureEnd
s1na Mar 13, 2024
2612c60
add blob burnt fee
s1na Mar 13, 2024
188458e
minor
s1na Mar 13, 2024
cff9fba
rm extra param
s1na Mar 13, 2024
f3d18d6
tests, appveyor: only execute one in four permutations on CI (#29220)
holiman Mar 13, 2024
57308be
go.mod: update golang.org/x/crypto from v0.17.0 to v0.21.0 (#29228)
songzhibin97 Mar 13, 2024
3c26ffe
eth/catalyst: remove error return in delayPayloadImport (#29043)
tmelhao Mar 13, 2024
20d3e0a
cmd/devp2p: fix decoding of raw RLP ENR attributes (#29257)
weiihann Mar 14, 2024
817e261
Call `OnBlockchainInit` before `OnGenesisBlock` (#22)
maoueh Mar 14, 2024
17f95b9
fix empty tracer config
s1na Mar 14, 2024
d28adb6
cmd/emv/internal/t8ntool: fix shadowing of `excessBlobGas` (#29263)
dyxushuai Mar 14, 2024
543d27c
simplify eip1559 test
s1na Mar 14, 2024
cffb7c8
params: use the same variable name as EIP-4788 (#29195)
tmelhao Mar 15, 2024
95715fd
eth/downloader, graphql: fix typos (#29243)
shivhg Mar 15, 2024
40cac1d
eth/catalyst: prettier output on bad new payloads (#29259)
holiman Mar 15, 2024
ba2dd93
accounts/abi/bind: remove unused err set and check (#29269)
kumakichi Mar 15, 2024
0124d16
refactors
s1na Mar 15, 2024
c611924
go.mod: update protobuf (#29270)
holiman Mar 18, 2024
4636dd3
cmd/evm: fix tracing
holiman Mar 18, 2024
25051c9
cmd/evm: add testcase for js-tracer
holiman Mar 18, 2024
e320d1e
core/vm: documentation + minor refactoring
holiman Mar 18, 2024
4f87f17
eth/tracers, cmd/evm: unexport JSONlogger
holiman Mar 18, 2024
ab49f22
all: update to go version 1.22.1 (#28946)
holiman Mar 18, 2024
15eb977
triedb/pathdb: improve tests (#29278)
rjl493456442 Mar 19, 2024
ac6060a
log: replace tmp with bytes.Buffer.AvailableBuffer (#29287)
AaronChen0 Mar 19, 2024
6b3d4d0
beacon/light/sync: fix typo in comment (#29256)
AtomicInnovation321 Mar 19, 2024
eda9c7e
accounts/abi/bind: check invalid chainID first (#29275)
htiennv Mar 19, 2024
4c1b578
miner: modify header before checking time-based fields (#29242)
buddh0 Mar 19, 2024
d21e92c
refactor args to msg and tx
s1na Mar 19, 2024
6f929a0
core/asm: minor code-clarification (#29293)
zgfzgf Mar 20, 2024
45b88ab
all: fix typos (#29288)
miles-six Mar 20, 2024
0ceac8d
metrics: fix docstrings (#29279)
georgehao Mar 20, 2024
de08f3d
cmd/evm: make staterunner always output stateroot to stderr (#29290)
holiman Mar 20, 2024
9a7e6ce
cmd/evm: fix flag-mismatch from #29290 (#29298)
holiman Mar 20, 2024
22ac46c
Makefile: update PHONY directive (#29296)
imalasong Mar 20, 2024
78c102d
core: skip the check the statefulness of head block in repair (#29245)
rjl493456442 Mar 20, 2024
0444388
core/txpool/blobpool: calculate log1.125 faster (#29300)
AaronChen0 Mar 20, 2024
8f7fbdf
core: refactor consensus interface (#29283)
MariusVanDerWijden Mar 20, 2024
04bf1c8
eth/protocols/snap, internal/testlog: fix dataraces (#29301)
holiman Mar 20, 2024
3f18501
fix merge conflict
s1na Mar 20, 2024
7a859d8
Merge branch 'extended-tracer-struct' into extended-tracer-chris
s1na Mar 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Diederik Loerakker <[email protected]>
Dimitry Khokhlov <[email protected]>

Domino Valdano <[email protected]>
Domino Valdano <[email protected]> <[email protected]>

Edgar Aroutiounian <[email protected]>

Expand Down
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
os: linux
arch: amd64
dist: bionic
go: 1.21.x
go: 1.22.x
env:
- docker
services:
Expand All @@ -33,7 +33,7 @@ jobs:
os: linux
arch: arm64
dist: bionic
go: 1.21.x
go: 1.22.x
env:
- docker
services:
Expand All @@ -51,7 +51,7 @@ jobs:
os: linux
dist: bionic
sudo: required
go: 1.21.x
go: 1.22.x
env:
- azure-linux
git:
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
if: type = push
os: osx
osx_image: xcode14.2
go: 1.21.x
go: 1.22.x
env:
- azure-osx
git:
Expand All @@ -101,7 +101,7 @@ jobs:
os: linux
arch: amd64
dist: bionic
go: 1.21.x
go: 1.22.x
script:
- travis_wait 30 go run build/ci.go test $TEST_PACKAGES

Expand All @@ -110,14 +110,14 @@ jobs:
os: linux
arch: arm64
dist: bionic
go: 1.20.x
go: 1.21.x
script:
- travis_wait 30 go run build/ci.go test $TEST_PACKAGES

- stage: build
os: linux
dist: bionic
go: 1.20.x
go: 1.21.x
script:
- travis_wait 30 go run build/ci.go test $TEST_PACKAGES

Expand All @@ -126,7 +126,7 @@ jobs:
if: type = cron || (type = push && tag ~= /^v[0-9]/)
os: linux
dist: bionic
go: 1.21.x
go: 1.22.x
env:
- ubuntu-ppa
git:
Expand All @@ -149,7 +149,7 @@ jobs:
if: type = cron
os: linux
dist: bionic
go: 1.21.x
go: 1.22.x
env:
- azure-purge
git:
Expand All @@ -162,7 +162,7 @@ jobs:
if: type = cron
os: linux
dist: bionic
go: 1.21.x
go: 1.22.x
script:
- travis_wait 30 go run build/ci.go test -race $TEST_PACKAGES

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG VERSION=""
ARG BUILDNUM=""

# Build Geth in a stock Go builder container
FROM golang:1.21-alpine as builder
FROM golang:1.22-alpine as builder

RUN apk add --no-cache gcc musl-dev linux-headers git

Expand All @@ -25,7 +25,7 @@ COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
EXPOSE 8545 8546 30303 30303/udp
ENTRYPOINT ["geth"]

# Add some metadata labels to help programatic image consumption
# Add some metadata labels to help programmatic image consumption
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.alltools
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG VERSION=""
ARG BUILDNUM=""

# Build Geth in a stock Go builder container
FROM golang:1.21-alpine as builder
FROM golang:1.22-alpine as builder

RUN apk add --no-cache gcc musl-dev linux-headers git

Expand All @@ -24,7 +24,7 @@ COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/

EXPOSE 8545 8546 30303 30303/udp

# Add some metadata labels to help programatic image consumption
# Add some metadata labels to help programmatic image consumption
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.

.PHONY: geth android ios evm all test clean
.PHONY: geth all test lint clean devtools help

GOBIN = ./build/bin
GO ?= latest
Expand Down Expand Up @@ -47,4 +47,3 @@ devtools:
help: Makefile
@echo " Choose a command run in go-ethereum:"
@sed -n 's/^#?//p' $< | column -t -s ':' | sort | sed -e 's/^/ /'
.PHONY: help
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ archives are published at https://geth.ethereum.org/downloads/.

For prerequisites and detailed build instructions please read the [Installation Instructions](https://geth.ethereum.org/docs/getting-started/installing-geth).

Building `geth` requires both a Go (version 1.19 or later) and a C compiler. You can install
Building `geth` requires both a Go (version 1.21 or later) and a C compiler. You can install
them using your favourite package manager. Once the dependencies are installed, run

```shell
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ func NewKeyStoreTransactorWithChainID(keystore *keystore.KeyStore, account accou
// NewKeyedTransactorWithChainID is a utility method to easily create a transaction signer
// from a single private key.
func NewKeyedTransactorWithChainID(key *ecdsa.PrivateKey, chainID *big.Int) (*TransactOpts, error) {
keyAddr := crypto.PubkeyToAddress(key.PublicKey)
if chainID == nil {
return nil, ErrNoChainID
}
keyAddr := crypto.PubkeyToAddress(key.PublicKey)
signer := types.LatestSignerForChainID(chainID)
return &TransactOpts{
From: keyAddr,
Expand Down
7 changes: 2 additions & 5 deletions accounts/abi/bind/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]int
if err != nil {
return nil, nil, err
}
sub, err := event.NewSubscription(func(quit <-chan struct{}) error {
sub := event.NewSubscription(func(quit <-chan struct{}) error {
for _, log := range buff {
select {
case logs <- log:
Expand All @@ -470,11 +470,8 @@ func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]int
}
}
return nil
}), nil
})

if err != nil {
return nil, nil, err
}
return logs, sub, nil
}

Expand Down
3 changes: 0 additions & 3 deletions accounts/abi/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ func NewType(t string, internalType string, components []ArgumentMarshaling) (ty
return Type{}, errors.New("abi: purely anonymous or underscored field is not supported")
}
fieldName := ResolveNameConflict(name, func(s string) bool { return used[s] })
if err != nil {
return Type{}, err
}
used[fieldName] = true
if !isValidFieldName(fieldName) {
return Type{}, fmt.Errorf("field %d has invalid name", idx)
Expand Down
2 changes: 1 addition & 1 deletion accounts/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func TextHash(data []byte) []byte {
//
// This gives context to the signed message and prevents signing of transactions.
func TextAndHash(data []byte) ([]byte, string) {
msg := fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(data), string(data))
msg := fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(data), data)
hasher := sha3.NewLegacyKeccak256()
hasher.Write([]byte(msg))
return hasher.Sum(nil), msg
Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/account_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func waitForAccounts(wantAccounts []accounts.Account, ks *KeyStore) error {
func TestWatchNewFile(t *testing.T) {
t.Parallel()

dir, ks := tmpKeyStore(t, false)
dir, ks := tmpKeyStore(t)

// Ensure the watcher is started before adding any files.
ks.Accounts()
Expand Down
9 changes: 0 additions & 9 deletions accounts/keystore/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,6 @@ func NewKeyStore(keydir string, scryptN, scryptP int) *KeyStore {
return ks
}

// NewPlaintextKeyStore creates a keystore for the given directory.
// Deprecated: Use NewKeyStore.
func NewPlaintextKeyStore(keydir string) *KeyStore {
keydir, _ = filepath.Abs(keydir)
ks := &KeyStore{storage: &keyStorePlain{keydir}}
ks.init(keydir)
return ks
}

func (ks *KeyStore) init(keydir string) {
// Lock the mutex since the account cache might call back with events
ks.mu.Lock()
Expand Down
34 changes: 15 additions & 19 deletions accounts/keystore/keystore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var testSigData = make([]byte, 32)

func TestKeyStore(t *testing.T) {
t.Parallel()
dir, ks := tmpKeyStore(t, true)
dir, ks := tmpKeyStore(t)

a, err := ks.NewAccount("foo")
if err != nil {
Expand Down Expand Up @@ -72,7 +72,7 @@ func TestKeyStore(t *testing.T) {

func TestSign(t *testing.T) {
t.Parallel()
_, ks := tmpKeyStore(t, true)
_, ks := tmpKeyStore(t)

pass := "" // not used but required by API
a1, err := ks.NewAccount(pass)
Expand All @@ -89,7 +89,7 @@ func TestSign(t *testing.T) {

func TestSignWithPassphrase(t *testing.T) {
t.Parallel()
_, ks := tmpKeyStore(t, true)
_, ks := tmpKeyStore(t)

pass := "passwd"
acc, err := ks.NewAccount(pass)
Expand Down Expand Up @@ -117,7 +117,7 @@ func TestSignWithPassphrase(t *testing.T) {

func TestTimedUnlock(t *testing.T) {
t.Parallel()
_, ks := tmpKeyStore(t, true)
_, ks := tmpKeyStore(t)

pass := "foo"
a1, err := ks.NewAccount(pass)
Expand Down Expand Up @@ -152,7 +152,7 @@ func TestTimedUnlock(t *testing.T) {

func TestOverrideUnlock(t *testing.T) {
t.Parallel()
_, ks := tmpKeyStore(t, false)
_, ks := tmpKeyStore(t)

pass := "foo"
a1, err := ks.NewAccount(pass)
Expand Down Expand Up @@ -193,7 +193,7 @@ func TestOverrideUnlock(t *testing.T) {
// This test should fail under -race if signing races the expiration goroutine.
func TestSignRace(t *testing.T) {
t.Parallel()
_, ks := tmpKeyStore(t, false)
_, ks := tmpKeyStore(t)

// Create a test account.
a1, err := ks.NewAccount("")
Expand Down Expand Up @@ -238,7 +238,7 @@ func waitForKsUpdating(t *testing.T, ks *KeyStore, wantStatus bool, maxTime time
func TestWalletNotifierLifecycle(t *testing.T) {
t.Parallel()
// Create a temporary keystore to test with
_, ks := tmpKeyStore(t, false)
_, ks := tmpKeyStore(t)

// Ensure that the notification updater is not running yet
time.Sleep(250 * time.Millisecond)
Expand Down Expand Up @@ -284,7 +284,7 @@ type walletEvent struct {
// or deleted from the keystore.
func TestWalletNotifications(t *testing.T) {
t.Parallel()
_, ks := tmpKeyStore(t, false)
_, ks := tmpKeyStore(t)

// Subscribe to the wallet feed and collect events.
var (
Expand Down Expand Up @@ -346,7 +346,7 @@ func TestWalletNotifications(t *testing.T) {
// TestImportExport tests the import functionality of a keystore.
func TestImportECDSA(t *testing.T) {
t.Parallel()
_, ks := tmpKeyStore(t, true)
_, ks := tmpKeyStore(t)
key, err := crypto.GenerateKey()
if err != nil {
t.Fatalf("failed to generate key: %v", key)
Expand All @@ -365,7 +365,7 @@ func TestImportECDSA(t *testing.T) {
// TestImportECDSA tests the import and export functionality of a keystore.
func TestImportExport(t *testing.T) {
t.Parallel()
_, ks := tmpKeyStore(t, true)
_, ks := tmpKeyStore(t)
acc, err := ks.NewAccount("old")
if err != nil {
t.Fatalf("failed to create account: %v", acc)
Expand All @@ -374,7 +374,7 @@ func TestImportExport(t *testing.T) {
if err != nil {
t.Fatalf("failed to export account: %v", acc)
}
_, ks2 := tmpKeyStore(t, true)
_, ks2 := tmpKeyStore(t)
if _, err = ks2.Import(json, "old", "old"); err == nil {
t.Errorf("importing with invalid password succeeded")
}
Expand All @@ -394,7 +394,7 @@ func TestImportExport(t *testing.T) {
// This test should fail under -race if importing races.
func TestImportRace(t *testing.T) {
t.Parallel()
_, ks := tmpKeyStore(t, true)
_, ks := tmpKeyStore(t)
acc, err := ks.NewAccount("old")
if err != nil {
t.Fatalf("failed to create account: %v", acc)
Expand All @@ -403,7 +403,7 @@ func TestImportRace(t *testing.T) {
if err != nil {
t.Fatalf("failed to export account: %v", acc)
}
_, ks2 := tmpKeyStore(t, true)
_, ks2 := tmpKeyStore(t)
var atom atomic.Uint32
var wg sync.WaitGroup
wg.Add(2)
Expand Down Expand Up @@ -457,11 +457,7 @@ func checkEvents(t *testing.T, want []walletEvent, have []walletEvent) {
}
}

func tmpKeyStore(t *testing.T, encrypted bool) (string, *KeyStore) {
func tmpKeyStore(t *testing.T) (string, *KeyStore) {
d := t.TempDir()
newKs := NewPlaintextKeyStore
if encrypted {
newKs = func(kd string) *KeyStore { return NewKeyStore(kd, veryLightScryptN, veryLightScryptP) }
}
return d, newKs(d)
return d, NewKeyStore(d, veryLightScryptN, veryLightScryptP)
}
5 changes: 2 additions & 3 deletions accounts/scwallet/securechannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/elliptic"
"crypto/rand"
"crypto/sha256"
"crypto/sha512"
Expand Down Expand Up @@ -72,11 +71,11 @@ func NewSecureChannelSession(card *pcsc.Card, keyData []byte) (*SecureChannelSes
if err != nil {
return nil, fmt.Errorf("could not unmarshal public key from card: %v", err)
}
secret, _ := key.Curve.ScalarMult(cardPublic.X, cardPublic.Y, key.D.Bytes())
secret, _ := crypto.S256().ScalarMult(cardPublic.X, cardPublic.Y, key.D.Bytes())
return &SecureChannelSession{
card: card,
secret: secret.Bytes(),
publicKey: elliptic.Marshal(crypto.S256(), key.PublicKey.X, key.PublicKey.Y),
publicKey: crypto.FromECDSAPub(&key.PublicKey),
}, nil
}

Expand Down
Loading