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

[Upgrade] Go-Ethereum release v1.9.8 #1112

Merged
merged 1,153 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
1153 commits
Select commit Hold shift + click to select a range
2890f06
core/vm, crypto/blake2b: add BLAKE2b compression func at 0x09
pdyraga Jun 17, 2019
1bccafe
core/vm, crypto/blake2b: add SSE, AVX and AVX2 code
karalabe Aug 21, 2019
22fdbee
Merge pull request #19972 from keep-network/istanbul-eip-152-blake2b-…
karalabe Aug 22, 2019
8517dd4
crypto/blake2b: fix non-amd64 builds
karalabe Aug 22, 2019
5b2c47a
Merge pull request #19990 from karalabe/fix-blake2b-386
karalabe Aug 22, 2019
8e391ce
crypto/blake2b: fix 386, round 2
karalabe Aug 22, 2019
ac23073
Merge pull request #19992 from karalabe/fix-blake2b-386-2
karalabe Aug 22, 2019
7c22994
core: log chain reorg/split metrics (#18950)
hackmod Aug 22, 2019
1cd5bf0
common: unify hex prefix check code (#19937)
lmittmann Aug 22, 2019
46ec63b
ethdb/dbtest: addd test suite for ethdb backends (#19960)
shazow Aug 22, 2019
060e33f
core/vm: enable istanbul EIPs in the jump table
karalabe Aug 22, 2019
4ef5e97
build: gomobile automaticall adds the ios tag, don't duplicate
karalabe Aug 22, 2019
1eaf66a
Merge pull request #19995 from karalabe/ios-notag
karalabe Aug 22, 2019
4d358b9
cmd/utils: customize cli.HelpPrinter to fix alignment (#19956)
SjonHortensius Aug 22, 2019
b90cdba
p2p/enode: allow DNS names in enode URLs (#18524)
dipingxian2 Aug 22, 2019
54b271a
crypto: add SignatureLength constant and use it everywhere (#19996)
fjl Aug 22, 2019
961aa05
rpc: enable compression on HTTP transport (#19997)
SjonHortensius Aug 22, 2019
e126b08
retesteth: implement istanbul support
holiman Aug 23, 2019
4aeeddc
tests: implement Istanbul support
holiman Aug 23, 2019
c8a1c0a
Merge pull request #19993 from karalabe/istanbul-eip-integration
karalabe Aug 23, 2019
e39b2a2
acmd, core, eth, les: support --override.istanbul
karalabe Aug 23, 2019
cc9eb91
Merge pull request #20004 from karalabe/istanbul-override
karalabe Aug 23, 2019
a978adf
README: change chainID to <arbitrary positive integer> (#20002)
FlashSheridan Aug 26, 2019
6850259
les: wait for all task goroutines before dropping the peer (#20010)
rjl493456442 Aug 27, 2019
396f1dd
les: fix panic (#20013)
rjl493456442 Aug 27, 2019
292cf7c
eth: disallow overwrite files via admin.exportChain
holiman Aug 30, 2019
d5bd383
Merge pull request #20019 from holiman/minor_adminfix
karalabe Aug 30, 2019
cedf8be
retesteth: enable maxResults in AccountRange (#20020)
winsvega Sep 2, 2019
af16ca1
rpc: raise limit in TestClientNotificationStorm (#19999)
fjl Sep 2, 2019
b8a9457
Merge pull request #19915 from holiman/filltx
karalabe Sep 3, 2019
1611815
cmd/utils: reduce light.maxpeers default for clients to 1/10th (#19933)
SjonHortensius Sep 3, 2019
cfbb969
params: release Geth v1.9.3 stable
karalabe Sep 3, 2019
b4a4a4d
params: begin Geth v1.9.4 release cycle
karalabe Sep 3, 2019
ce2da83
Dockerfile: expose GraphQL ports
karalabe Sep 4, 2019
67bfc93
Merge pull request #20033 from karalabe/docker-expose-graphql
karalabe Sep 4, 2019
cea2c80
README: accounts in alloc field should exist (#20005)
FlashSheridan Sep 10, 2019
49b86a2
common, graphql: fix hash/address decoding + UI content type
karalabe Sep 10, 2019
4f6bf2f
Merge pull request #20046 from karalabe/graphql-fix-web-and-decoding
karalabe Sep 10, 2019
72d5a27
core, metrics, p2p: switch some invalid counters to gauges
karalabe Sep 10, 2019
46b437f
Merge pull request #20047 from karalabe/counter-to-gauge
karalabe Sep 10, 2019
72045df
core/state: optimize some internals during encoding
holiman Sep 5, 2019
305ed95
Merge pull request #20038 from holiman/minor_encodingfix
karalabe Sep 10, 2019
52a967c
eth: remove unused field (#20049)
trung Sep 10, 2019
91b7349
tests: expose internal RunNoVerify method (#20051)
holiman Sep 11, 2019
39b0b1a
all: make unit tests work with Go 1.13 (#20053)
fjl Sep 11, 2019
2469c4e
travis, Dockerfile, appveyor: bump to Go 1.13
karalabe Sep 12, 2019
71251c7
Merge pull request #20058 from karalabe/go1.13
karalabe Sep 12, 2019
c02d5bc
build: switch PPA from Gophers dep to manual download
karalabe Sep 12, 2019
8eb646a
Merge pull request #20059 from karalabe/ppa-manual-go
karalabe Sep 12, 2019
efe1237
Revert "build: switch PPA from Gophers dep to manual download" (#20061)
karalabe Sep 12, 2019
3b6c990
core: remove unused gas return in ApplyTransaction (#20065)
rmulhol Sep 12, 2019
96fb839
rlp: improve nil pointer handling (#20064)
fjl Sep 13, 2019
16f0fb7
cmd/evm: make evm default to all ethash protocol changes
holiman Sep 13, 2019
223b950
core/state: accumulate writes and only update tries when must
karalabe Aug 12, 2019
f49d6e5
core: add blockchain test too for revert cornercase
holiman Sep 16, 2019
aff9869
Merge pull request #19953 from karalabe/state-accumulate-writes
karalabe Sep 16, 2019
b1c3010
common/mclock: clean up AfterFunc support (#20054)
fjl Sep 16, 2019
8bd64f4
Merge pull request #20075 from holiman/evm_defaults
karalabe Sep 16, 2019
8d41e88
core: smaller txpool status locking (#20080)
holiman Sep 17, 2019
056183c
core: dedup known transactions without global lock, track metrics
karalabe Sep 17, 2019
d4dce43
Merge pull request #20081 from karalabe/txpool-lockless-dedup
karalabe Sep 17, 2019
0ac9bbb
les: multiple server bugfixes (#20079)
zsfelfoldi Sep 17, 2019
f40ff23
core: fix tx dedup return error count
karalabe Sep 18, 2019
7b32d2a
Merge pull request #20085 from karalabe/txpool-api-fix
karalabe Sep 18, 2019
ad380cd
params: activate Istanbul on Ropsten and Görli
soc1c Sep 19, 2019
2becb99
params: bump CHTs for the 1.9.4 release
karalabe Sep 19, 2019
03c7d8f
Merge pull request #20091 from karalabe/cht-1.9.4
karalabe Sep 19, 2019
f9eb307
core/forkid, params: fix tests, enable Istanbul on Rinkeby + testers
karalabe Sep 19, 2019
a6a14f6
Merge pull request #20090 from soc1c/s1-testnet-istanbul
karalabe Sep 19, 2019
9f98628
vendor: pull in USB Windows fixes
karalabe Sep 19, 2019
c0010f0
Merge pull request #20092 from karalabe/vendor-usb-bump
karalabe Sep 19, 2019
46891c1
params: release Geth v1.9.4 stable
karalabe Sep 19, 2019
24ef835
params: start v1.9.5 release cycle
karalabe Sep 19, 2019
75aec8a
params: remove legacy bootnodes
skylenet Sep 19, 2019
05347b3
core/state: fix state object deep copy (#20100)
rjl493456442 Sep 20, 2019
a1c09b9
params: release Geth v1.9.5 stable
fjl Sep 20, 2019
63b1802
params: start v1.9.6 release cycle
fjl Sep 20, 2019
311419c
Merge pull request #20096 from skylenet/remove-ef-legacy-bootnodes
karalabe Sep 23, 2019
a308f01
core/state: fix copy-commit-copy (#20113)
karalabe Sep 24, 2019
be500b5
dashboard: log host+port
holiman Sep 24, 2019
aca39a6
Merge pull request #20115 from holiman/minor_dashboard_fx
karalabe Sep 24, 2019
32b07e8
les: fix checkpoint sync (#20120)
rjl493456442 Sep 25, 2019
0568e81
p2p/dnsdisc: add implementation of EIP-1459 (#20094)
fjl Sep 25, 2019
62391dd
tests/solidity: add contract to test every opcode (#19283)
lhendre Sep 26, 2019
ad03d98
internal/ethapi: support block number or hash on state-related method…
ryanschneider Sep 26, 2019
1a6ef5a
core/blockchain: remove block from futureBlocks on error (#19763)
ywzqwwt Sep 26, 2019
2133f18
core/state: fix database leak and copy tests (#19306)
zcheng9 Sep 26, 2019
ead7117
core: initialize current block/fastblock atomics to nil, fix #19286 (…
holiman Sep 26, 2019
df89233
ethdb/leveldb: disable seek compaction (#20130)
rjl493456442 Sep 26, 2019
a2a6086
p2p: measure subprotocol bandwidth usage
karalabe Sep 27, 2019
62b43ee
Merge pull request #20133 from karalabe/measure-subprotocol-traffic
karalabe Sep 30, 2019
b2f696e
github: Added capital P (#20139)
kishore-hariram Sep 30, 2019
7f5f62a
tests: update test suite for istanbul (#20082)
holiman Oct 2, 2019
c713ea7
cmd/bootnode: fix exit behavior with -genkey (#20110)
dherbst Oct 2, 2019
6e73091
les: add empty "les" ENR entry for servers (#20145)
fjl Oct 2, 2019
bd05968
params: release Geth v1.9.6 stable
fjl Oct 3, 2019
a73f3f4
params: begin v1.9.7 release cycle
fjl Oct 3, 2019
028af34
cmd/utils: fix command line flag resolve (#20167)
rjl493456442 Oct 15, 2019
c476460
params: check fork ordering when initializing new genesis, fixes #201…
holiman Oct 16, 2019
7300365
p2p/dnsdisc: update to latest EIP-1459 spec (#20168)
fjl Oct 16, 2019
d5b79e7
p2p/simulations: add node properties support and utility functions (#…
chadsr Oct 17, 2019
a28093c
README: use new miner threads flag instead of legacy minerthreads fla…
jeffwalsh Oct 17, 2019
9a77065
Changed http:// to https:// on links in log/README.md (#20178)
sandakersmann Oct 18, 2019
b9299bb
dashboard: change links in README to https (#20181)
sandakersmann Oct 18, 2019
08953e4
metrics: change links in README.md to https (#20182)
sandakersmann Oct 20, 2019
d4bb379
miner: add generate and import unit test (#20111)
rjl493456442 Oct 20, 2019
538f763
accounts/abi/bind: take into account gas price during gas estimation …
pdyraga Oct 21, 2019
db79143
clef: resolve windows pipes, fixes #20121 (#20166)
holiman Oct 24, 2019
72617a0
consensus: fix possessives in comments. (#20209)
gballet Oct 28, 2019
9c81387
cmd/evm: remove surrounding whitespace in hex input code (#20211)
michaelforney Oct 28, 2019
ecdbb40
trie: remove node ordering slice in sync batch (#19929)
rjl493456442 Oct 28, 2019
b0b2775
core/asm: assembly parser label fixes (#20210)
michaelforney Oct 29, 2019
3eca7b5
eth/downloader: fix data race in downloader
holiman Oct 25, 2019
2c37142
cmd/devp2p, p2p: dial using node iterator, discovery crawler (#20132)
fjl Oct 29, 2019
e306304
Merge pull request #20204 from holiman/fix_downloader_race
karalabe Oct 29, 2019
64571f9
eth: eth/64 - extend handshake packet with fork id
karalabe Sep 30, 2019
9641cac
core/forkid: add two clauses for more precise validation (#20220)
karalabe Oct 30, 2019
5d91acc
miner: increase import time allowance (#20217)
rjl493456442 Oct 30, 2019
93422e9
Merge pull request #20140 from karalabe/eth64-handshake-forkid
karalabe Oct 30, 2019
8927f77
cmd/devp2p, core/forkid: make forkid.Filter API uniform
karalabe Oct 31, 2019
12f2a25
Merge pull request #20225 from karalabe/forkid-eth-handshake-verifica…
karalabe Oct 31, 2019
9278951
params, core/forkid: configure mainnet istanbul block 9069K (#20222)
holiman Oct 31, 2019
44b74cf
accounts/abi: add internalType information and fix issues (#20179)
rjl493456442 Oct 31, 2019
86fe283
appveyor: bump to Go 1.13.4
SamuelMarks Nov 2, 2019
0ce5e11
les: rework clientpool (#20077)
rjl493456442 Nov 2, 2019
0ff7380
Merge pull request #20231 from SamuelMarks/go1.13.4
karalabe Nov 4, 2019
7a6d5d0
cmd/puppeth: integrate istanbul into puppeth (#19926)
rjl493456442 Nov 4, 2019
b566cfd
core/evm: avoid copying memory for input in calls (#20177)
holiman Nov 4, 2019
734e00a
travis, build, internal: use own Go bundle for PPA builds (#20240)
karalabe Nov 5, 2019
c702bd7
travis: bump linter to Go 1.13.x
karalabe Nov 5, 2019
9948724
params: hard-code new CHTs for the 1.9.7 release
karalabe Nov 6, 2019
fc3661f
Merge pull request #20248 from karalabe/cht-1.9.7
karalabe Nov 6, 2019
b9bac1f
les: fix and slim the unit tests of les (#20247)
rjl493456442 Nov 6, 2019
a718daa
params: release Geth v1.9.7
karalabe Nov 7, 2019
4b8f56c
params: begin v1.9.8 release cycle
karalabe Nov 7, 2019
adf007d
p2p/enode: mock DNS resolver in URL parsing test (#20252)
fjl Nov 7, 2019
de2259d
travis: enable test suite on ARM64 (#20219)
gballet Nov 8, 2019
6f1a600
p2p: fix bug in TestPeerDisconnect (#20277)
Nov 13, 2019
4ea9b62
dashboard: send current block to the dashboard client (#19762)
kurkomisi Nov 13, 2019
22e3bbb
miner: increase worker test timeout (#20268)
gballet Nov 13, 2019
bf5c6b2
les: implement server priority API (#20070)
zsfelfoldi Nov 13, 2019
f8a95d9
accounts/abi/bind, cmd/abigen: implement alias for abigen (#20244)
rjl493456442 Nov 14, 2019
9504c5c
rpc: fix typo example code (#20284)
Jorropo Nov 14, 2019
987648b
cmd/faucet: use github.com/gorilla/websocket (#20283)
fjl Nov 14, 2019
afe0b65
dashboard: remove the dashboard (#20279)
fjl Nov 14, 2019
765fe44
whisper/whisperv6: fix staticcheck issues (#20288)
gballet Nov 14, 2019
49d1a03
build: gather info to investigate why builds fail on ARM (#20281)
gballet Nov 14, 2019
f03b2db
params: finish sentence in comment (#20291)
meowsbits Nov 14, 2019
738b51a
core/vm: fix tracer interface parameter name (#20294)
nebojsa94 Nov 15, 2019
51c3290
internal/ethapi: don't query wallets at every execution of gas estima…
holiman Nov 11, 2019
9e71f55
cmd/evm: Allow loading input from file (#20273)
michaelforney Nov 17, 2019
7c4a4eb
rpc, p2p/simulations: use github.com/gorilla/websocket (#20289)
fjl Nov 18, 2019
6894864
build: use golangci-lint (#20295)
fjl Nov 18, 2019
11d09fd
travis: remove traces and use travis_wait in ARM build (#20296)
gballet Nov 18, 2019
57d6976
core: s/isEIP155/isHomestead/g (fix IntrinsicGas signature var name) …
meowsbits Nov 18, 2019
422604b
les: rename UpdateBalance to AddBalance and simplify return format (#…
zsfelfoldi Nov 18, 2019
b02afb6
travis: use travis_wait for both install and build (#20309)
gballet Nov 18, 2019
190fb81
build: add test cmd flag -v for verbose logs (#20298)
meowsbits Nov 18, 2019
a3d263d
cmd/clef: fix staticcheck warnings (#20314)
fjl Nov 18, 2019
3f4a875
consensus/clique: add clique_status API method (#20103)
holiman Nov 18, 2019
c5c5e0d
consensus/clique: fix struct tags for status API (#20316)
fjl Nov 18, 2019
dfe8912
cmd/ethkey: fix file permissions in changepassword command (#20313)
fjl Nov 19, 2019
5fefe39
p2p/netutil: fix staticcheck warning (#20315)
fjl Nov 19, 2019
b9c90c5
core/rawdb: check hash before return data from ancient db (#20195)
rjl493456442 Nov 19, 2019
0b63383
travis: deactivate arm build during push (#20321)
gballet Nov 19, 2019
c013192
ethclient: remove use of common.ToHex (#20326)
fjl Nov 19, 2019
94e8250
cmd/wnode: remove uses of common.ToHex (#20327)
fjl Nov 19, 2019
7f70a70
event: remove unused field 'closed' (#20324)
fjl Nov 19, 2019
3b0f348
.github: remove 'nonsense' from CODEOWNERS (#20329)
gballet Nov 19, 2019
ac5e28e
whisper/whisperv6: fix staticcheck warnings (#20328)
fjl Nov 19, 2019
9e8cc00
p2p: remove unused code (#20325)
fjl Nov 19, 2019
df206d2
p2p/simulations: fix staticcheck warnings (#20322)
fjl Nov 19, 2019
9c6cf96
internal/web3ext, les: update clique JS and make it work with the lig…
fjl Nov 19, 2019
8008c5b
rpc: remove 'exported or builtin' restriction for parameters (#20332)
fjl Nov 20, 2019
f71e85b
core: fix staticcheck warnings (#20323)
fjl Nov 20, 2019
9b59c75
miner: fix data race in tests (#20310)
rjl493456442 Nov 20, 2019
b7ba944
cmd/puppeth: update chain spec of parity (#20241)
rjl493456442 Nov 20, 2019
3a4a3d0
Merge pull request #20261 from holiman/less_querying
karalabe Nov 20, 2019
15fb780
go.mod, vendor: switch to Go modules
karalabe Nov 18, 2019
dfdb204
travis: explicitly enable go modules in Go 1.11 and 1.12
karalabe Nov 18, 2019
f4ec854
accounts/abi/bind: switch binding test to go modules
karalabe Nov 18, 2019
b3d6304
travis, build: aggregate and upload go mod dependencies for PPA
karalabe Nov 18, 2019
e1dcea8
go.mod: tidy up the modules to avoid xgo writes to go.sum
karalabe Nov 18, 2019
a7dfaa0
build, internal/build: drop own file/folder copier
karalabe Nov 18, 2019
8bd5bb8
travis: fake build ppa only for go module dependencies
karalabe Nov 18, 2019
f8790b9
mobile: fix CopyFile switch to package cp
karalabe Nov 18, 2019
b8ced9e
tests: refactor TestState to dedupe walk callback
meowsbits Nov 20, 2019
75e029d
build, travis: use ephemeral debsrc GOPATH to get mod deps
karalabe Nov 20, 2019
b4bc3b3
tests: enable TransactionTests Istanbul case (#20337)
meowsbits Nov 20, 2019
c5b46a7
Merge pull request #20338 from etclabscore/feat/statetests-dedupe-wal…
karalabe Nov 20, 2019
59177bc
cmd/puppeth: x-spec nonce data type, use types.BlockNonce
meowsbits Nov 20, 2019
7be89a7
Merge pull request #20339 from etclabscore/fix/cmd-puppeth-blocknonce…
karalabe Nov 21, 2019
216ff5a
cmd/puppeth: make ssh prompt more user-friendly
holiman Nov 21, 2019
f56f969
Merge pull request #20350 from holiman/puppeth_ssh
karalabe Nov 21, 2019
72e62ef
common/hexutil: improve GraphQL error messages (#20353)
fjl Nov 21, 2019
89ab8a7
go.mod: switch to Go modules (#20311)
fjl Nov 21, 2019
475ae8b
build: pull in ci.go dependencies for the PPA builder
karalabe Nov 21, 2019
0754100
Merge pull request #20356 from karalabe/ppa-fix-cigo
karalabe Nov 21, 2019
0ec5ab4
common: improve GraphQL error messages (#20354)
fjl Nov 21, 2019
b6d4f6b
core/types: remove BlockBy sorting code (#20355)
fjl Nov 21, 2019
5b558ad
build: skip go clean on PPA, messes with the module trick
karalabe Nov 21, 2019
c1db636
Merge pull request #20360 from karalabe/ppa-fix-cigo-clean
karalabe Nov 21, 2019
bcc1234
accounts/abi/bind/backends: remove unused assignment (#20359)
fjl Nov 21, 2019
36a684c
accounts/abi: fix staticcheck warnings (#20358)
fjl Nov 21, 2019
dd21f07
core/state: fix staticcheck warnings (#20357)
fjl Nov 22, 2019
58f2ce8
metrics: fix issues reported by staticcheck (#20365)
gballet Nov 22, 2019
0abcf03
trie: remove unused code (#20366)
fjl Nov 22, 2019
fdff182
p2p/discv5: add deprecation warning and remove unused code (#20367)
fjl Nov 22, 2019
5d21667
tests, signer: remove staticcheck warnings (#20364)
gballet Nov 23, 2019
3a0480e
core/asm: allow numbers in labels (#20362)
michaelforney Nov 23, 2019
f06ae5c
miner: fix staticcheck warnings (#20375)
gballet Nov 24, 2019
f5a68a4
eth/tracers: fix staticcheck warnings (#20379)
gballet Nov 24, 2019
9d67222
trie: replace bigcache with fastcache (#19971)
rjl493456442 Nov 25, 2019
d9d2a4e
cmd/geth: remove network id from version cmd
meowsbits Nov 25, 2019
9ef90db
Merge pull request #20385 from etclabscore/fix/version-cmd-networkid
karalabe Nov 25, 2019
44b4164
rlp: fix staticcheck warnings (#20368)
fjl Nov 25, 2019
b26eedf
accounts/abi/bind: avoid reclaring structs (#20381)
rjl493456442 Nov 25, 2019
8c1e8de
accounts/keystore: fix staticcheck warnings (#20373)
gballet Nov 25, 2019
2e98706
p2p/discover: slow down lookups on empty table (#20389)
fjl Nov 26, 2019
878e35b
les: fix clientInfo deadlock (#20395)
zsfelfoldi Nov 26, 2019
d62e9b2
params: release go-ethereum v1.9.8
karalabe Nov 26, 2019
4d4b143
raft: read role change from rawNode().Ready() channel.
May 14, 2020
7c33c6c
Merge branch 'goeth_v1.9.8' into quorum-geth-1.9.8-upgrade
May 15, 2020
f3fff68
raft: fix unit test
May 19, 2020
6ae565f
raft: fix unit test
May 20, 2020
d341c66
fix unit test
May 20, 2020
d539997
node: retain quorum specific changes
May 20, 2020
8146a76
Merge remote-tracking branch 'remotes/origin/master' into quorum-geth…
Aug 6, 2020
1c2e0ea
resolve secp256k1 go.mod dependency
Aug 7, 2020
2049831
add `make bootnode`
Aug 11, 2020
bc78efc
fix unit test
Aug 13, 2020
4b3cc58
fix unit test
Aug 13, 2020
c0a9280
turn go mod on for linters
Aug 13, 2020
e8d15cd
Merge latest master from quorum
ricardolyn Jan 8, 2021
8b5bd9c
Rename self to s in leftovers from merge in statedb.go
ricardolyn Jan 8, 2021
3b09fc8
Deleted old vendor dependencies not necessary anymore.
ricardolyn Jan 8, 2021
2f14de7
Merge branch 'master' into upgrade/quorum-geth-1.9.8
ricardolyn Jan 8, 2021
8f2c98b
Fix Lint errors. Part 1.
ricardolyn Jan 8, 2021
fd63ccd
Fix lint issue with unused index
ricardolyn Jan 11, 2021
0f8d228
Run lint fixes automatically
ricardolyn Jan 11, 2021
5310443
Fix missing end of file line
ricardolyn Jan 11, 2021
94a44b9
fix: missing code that captures the ID and passes through the context
ricardolyn Jan 13, 2021
de15ddc
refactor: use testify asserts
ricardolyn Jan 13, 2021
b131389
test: fix invalid value when callbacks on the test service
ricardolyn Jan 13, 2021
b0ab094
fix: duplicated line that touches the smart contract on the EVM state
ricardolyn Jan 14, 2021
0351502
Merge branch 'master' into upgrade/quorum-geth-1.9.8
ricardolyn Jan 27, 2021
11aa268
fix: updated go version in go.mod to 1.15.5
ricardolyn Jan 27, 2021
7017f55
fix: version of go.mod to 1.15
ricardolyn Jan 27, 2021
5a218f2
Merge branch 'master' into upgrade/quorum-geth-1.9.8
ricardolyn Feb 1, 2021
63b65fb
fix: from review comments
ricardolyn Feb 2, 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
6 changes: 5 additions & 1 deletion rpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,11 @@ func (h *handler) handleSubscribe(cp *callProc, msg *jsonrpcMessage) *jsonrpcMes

// runMethod runs the Go callback for an RPC method.
func (h *handler) runMethod(ctx context.Context, msg *jsonrpcMessage, callb *callback, args []reflect.Value) *jsonrpcMessage {
result, err := callb.call(ctx, msg.Method, args)
//Quorum
//Pass the request ID to the method as part of the context, in case the method needs it later
contextWithId := context.WithValue(ctx, "id", &msg.ID)
//End-Quorum
result, err := callb.call(contextWithId, msg.Method, args)
if err != nil {
return msg.errorResponse(err)
}
Expand Down
35 changes: 35 additions & 0 deletions rpc/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,38 @@ func (s *stubAuthenticationManager) Authenticate(_ context.Context, _ string) (*
func (s *stubAuthenticationManager) IsEnabled(_ context.Context) (bool, error) {
return s.isEnabled, s.stubErr
}

// This test checks that the `ID` from the RPC call is passed to the handler method
ricardolyn marked this conversation as resolved.
Show resolved Hide resolved
func TestServerContextIdCaptured(t *testing.T) {
server := newTestServer()
defer server.Stop()

listener, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Fatal("can't listen:", err)
}
defer listener.Close()
go server.ServeListener(listener)

var (
request = `{"jsonrpc":"2.0","id":1,"method":"test_echoCtxId"}` + "\n"
wantResp = `{"jsonrpc":"2.0","id":1,"result":1}` + "\n"
)
conn, err := net.Dial("tcp", listener.Addr().String())
if err != nil {
t.Fatal("can't dial:", err)
}
defer conn.Close()
// Write the request, then half-close the connection so the server stops reading.
conn.Write([]byte(request))
conn.(*net.TCPConn).CloseWrite()
// Now try to get the response.
buf := make([]byte, 2000)
n, err := conn.Read(buf)
if err != nil {
t.Fatal("read error:", err)
}
if !bytes.Equal(buf[:n], []byte(wantResp)) {
t.Fatalf("wrong response: %s", buf[:n])
}
}
4 changes: 4 additions & 0 deletions rpc/testservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func (s *testService) EchoWithCtx(ctx context.Context, str string, i int, args *
return echoResult{str, i, args}
}

func (s *testService) EchoCtxId(ctx context.Context) interface{} {
return ctx.Value("id")
}

func (s *testService) Sleep(ctx context.Context, duration time.Duration) {
time.Sleep(duration)
}
Expand Down