Compare commits
4 Commits
v1.10.19
...
buildbot-t
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
621fd8fe7f | ||
|
|
019483bdaf | ||
|
|
7e0e69c622 | ||
|
|
0a05134c71 |
@@ -19,24 +19,10 @@ linters:
|
||||
- govet
|
||||
- ineffassign
|
||||
- misspell
|
||||
# - staticcheck
|
||||
- unconvert
|
||||
# - unused
|
||||
- varcheck
|
||||
- typecheck
|
||||
- unused
|
||||
- staticcheck
|
||||
- bidichk
|
||||
- durationcheck
|
||||
- exportloopref
|
||||
- gosec
|
||||
|
||||
#- structcheck # lots of false positives
|
||||
#- errcheck #lot of false positives
|
||||
# - contextcheck
|
||||
# - errchkjson # lots of false positives
|
||||
# - errorlint # this check crashes
|
||||
# - exhaustive # silly check
|
||||
# - makezero # false positives
|
||||
# - nilerr # several intentional
|
||||
|
||||
linters-settings:
|
||||
gofmt:
|
||||
@@ -44,28 +30,21 @@ linters-settings:
|
||||
goconst:
|
||||
min-len: 3 # minimum length of string constant
|
||||
min-occurrences: 6 # minimum number of occurrences
|
||||
gosec:
|
||||
excludes:
|
||||
- G404 # Use of weak random number generator - lots of FP
|
||||
- G107 # Potential http request -- those are intentional
|
||||
- G306 # G306: Expect WriteFile permissions to be 0600 or less
|
||||
|
||||
issues:
|
||||
exclude-rules:
|
||||
- path: crypto/bn256/cloudflare/optate.go
|
||||
- path: crypto/blake2b/
|
||||
linters:
|
||||
- deadcode
|
||||
- path: crypto/bn256/cloudflare
|
||||
linters:
|
||||
- deadcode
|
||||
- path: p2p/discv5/
|
||||
linters:
|
||||
- deadcode
|
||||
- path: core/vm/instructions_test.go
|
||||
linters:
|
||||
- goconst
|
||||
- path: cmd/faucet/
|
||||
linters:
|
||||
- deadcode
|
||||
- staticcheck
|
||||
- path: internal/build/pgp.go
|
||||
text: 'SA1019: package golang.org/x/crypto/openpgp is deprecated'
|
||||
- path: core/vm/contracts.go
|
||||
text: 'SA1019: package golang.org/x/crypto/ripemd160 is deprecated'
|
||||
- path: accounts/usbwallet/trezor.go
|
||||
text: 'SA1019: package github.com/golang/protobuf/proto is deprecated'
|
||||
- path: accounts/usbwallet/trezor/
|
||||
text: 'SA1019: package github.com/golang/protobuf/proto is deprecated'
|
||||
exclude:
|
||||
- 'SA1019: event.TypeMux is deprecated: use Feed'
|
||||
- 'SA1019: strings.Title is deprecated'
|
||||
- 'SA1029: should not use built-in type string as key for value'
|
||||
- 'G306: Expect WriteFile permissions to be 0600 or less'
|
||||
274
.mailmap
274
.mailmap
@@ -1,237 +1,123 @@
|
||||
Aaron Buchwald <aaron.buchwald56@gmail.com>
|
||||
Jeffrey Wilcke <jeffrey@ethereum.org>
|
||||
Jeffrey Wilcke <jeffrey@ethereum.org> <geffobscura@gmail.com>
|
||||
Jeffrey Wilcke <jeffrey@ethereum.org> <obscuren@obscura.com>
|
||||
Jeffrey Wilcke <jeffrey@ethereum.org> <obscuren@users.noreply.github.com>
|
||||
|
||||
Aaron Kumavis <kumavis@users.noreply.github.com>
|
||||
Viktor Trón <viktor.tron@gmail.com>
|
||||
|
||||
Abel Nieto <abel.nieto90@gmail.com>
|
||||
Abel Nieto <abel.nieto90@gmail.com> <anietoro@uwaterloo.ca>
|
||||
Joseph Goulden <joegoulden@gmail.com>
|
||||
|
||||
Afri Schoedon <58883403+q9f@users.noreply.github.com>
|
||||
Afri Schoedon <5chdn@users.noreply.github.com> <58883403+q9f@users.noreply.github.com>
|
||||
Nick Savers <nicksavers@gmail.com>
|
||||
|
||||
Alec Perseghin <aperseghin@gmail.com>
|
||||
Maran Hidskes <maran.hidskes@gmail.com>
|
||||
|
||||
Aleksey Smyrnov <i@soar.name>
|
||||
|
||||
Alex Leverington <alex@ethdev.com>
|
||||
Alex Leverington <alex@ethdev.com> <subtly@users.noreply.github.com>
|
||||
|
||||
Alex Pozhilenkov <alex_pozhilenkov@adoriasoft.com>
|
||||
Alex Pozhilenkov <alex_pozhilenkov@adoriasoft.com> <leshiy12345678@gmail.com>
|
||||
|
||||
Alexey Akhunov <akhounov@gmail.com>
|
||||
|
||||
Alon Muroch <alonmuroch@gmail.com>
|
||||
|
||||
Andrey Petrov <shazow@gmail.com>
|
||||
Andrey Petrov <shazow@gmail.com> <andrey.petrov@shazow.net>
|
||||
|
||||
Arkadiy Paronyan <arkadiy@ethdev.com>
|
||||
|
||||
Armin Braun <me@obrown.io>
|
||||
|
||||
Aron Fischer <github@aron.guru> <homotopycolimit@users.noreply.github.com>
|
||||
|
||||
Austin Roberts <code@ausiv.com>
|
||||
Austin Roberts <code@ausiv.com> <git@ausiv.com>
|
||||
Taylor Gerring <taylor.gerring@gmail.com>
|
||||
Taylor Gerring <taylor.gerring@gmail.com> <taylor.gerring@ethereum.org>
|
||||
|
||||
Bas van Kervel <bas@ethdev.com>
|
||||
Bas van Kervel <bas@ethdev.com> <basvankervel@ziggo.nl>
|
||||
Bas van Kervel <bas@ethdev.com> <basvankervel@gmail.com>
|
||||
Bas van Kervel <bas@ethdev.com> <bas-vk@users.noreply.github.com>
|
||||
|
||||
Boqin Qin <bobbqqin@bupt.edu.cn>
|
||||
Boqin Qin <bobbqqin@bupt.edu.cn> <Bobbqqin@gmail.com>
|
||||
Sven Ehlert <sven@ethdev.com>
|
||||
|
||||
Casey Detrio <cdetrio@gmail.com>
|
||||
Vitalik Buterin <v@buterin.com>
|
||||
|
||||
Cheng Li <lob4tt@gmail.com>
|
||||
|
||||
Chris Ziogas <ziogaschr@gmail.com>
|
||||
Chris Ziogas <ziogaschr@gmail.com> <ziogas_chr@hotmail.com>
|
||||
Marian Oancea <contact@siteshop.ro>
|
||||
|
||||
Christoph Jentzsch <jentzsch.software@gmail.com>
|
||||
|
||||
Diederik Loerakker <proto@protolambda.com>
|
||||
Heiko Hees <heiko@heiko.org>
|
||||
|
||||
Alex Leverington <alex@ethdev.com>
|
||||
Alex Leverington <alex@ethdev.com> <subtly@users.noreply.github.com>
|
||||
|
||||
Zsolt Felföldi <zsfelfoldi@gmail.com>
|
||||
|
||||
Gavin Wood <i@gavwood.com>
|
||||
|
||||
Martin Becze <mjbecze@gmail.com>
|
||||
Martin Becze <mjbecze@gmail.com> <wanderer@users.noreply.github.com>
|
||||
|
||||
Dimitry Khokhlov <winsvega@mail.ru>
|
||||
|
||||
Domino Valdano <dominoplural@gmail.com>
|
||||
Domino Valdano <dominoplural@gmail.com> <jeff@okcupid.com>
|
||||
Roman Mandeleil <roman.mandeleil@gmail.com>
|
||||
|
||||
Edgar Aroutiounian <edgar.factorial@gmail.com>
|
||||
Alec Perseghin <aperseghin@gmail.com>
|
||||
|
||||
Elliot Shepherd <elliot@identitii.com>
|
||||
Alon Muroch <alonmuroch@gmail.com>
|
||||
|
||||
Arkadiy Paronyan <arkadiy@ethdev.com>
|
||||
|
||||
Jae Kwon <jkwon.work@gmail.com>
|
||||
|
||||
Aaron Kumavis <kumavis@users.noreply.github.com>
|
||||
|
||||
Nick Dodson <silentcicero@outlook.com>
|
||||
|
||||
Jason Carver <jacarver@linkedin.com>
|
||||
Jason Carver <jacarver@linkedin.com> <ut96caarrs@snkmail.com>
|
||||
|
||||
Joseph Chow <ethereum@outlook.com>
|
||||
Joseph Chow <ethereum@outlook.com> ethers <TODO>
|
||||
|
||||
Enrique Fynn <enriquefynn@gmail.com>
|
||||
|
||||
Enrique Fynn <me@enriquefynn.com>
|
||||
Enrique Fynn <me@enriquefynn.com> <enriquefynn@gmail.com>
|
||||
Vincent G <caktux@gmail.com>
|
||||
|
||||
Ernesto del Toro <ernesto.deltoro@gmail.com>
|
||||
Ernesto del Toro <ernesto.deltoro@gmail.com> <ernestodeltoro@users.noreply.github.com>
|
||||
RJ Catalano <catalanor0220@gmail.com>
|
||||
RJ Catalano <catalanor0220@gmail.com> <rj@erisindustries.com>
|
||||
|
||||
Everton Fraga <ev@ethereum.org>
|
||||
Nchinda Nchinda <nchinda2@gmail.com>
|
||||
|
||||
Aron Fischer <github@aron.guru> <homotopycolimit@users.noreply.github.com>
|
||||
|
||||
Vlad Gluhovsky <gluk256@users.noreply.github.com>
|
||||
|
||||
Ville Sundell <github@solarius.fi>
|
||||
|
||||
Elliot Shepherd <elliot@identitii.com>
|
||||
|
||||
Yohann Léon <sybiload@gmail.com>
|
||||
|
||||
Gregg Dourgarian <greggd@tempworks.com>
|
||||
|
||||
Casey Detrio <cdetrio@gmail.com>
|
||||
|
||||
Jens Agerberg <github@agerberg.me>
|
||||
|
||||
Nick Johnson <arachnid@notdot.net>
|
||||
|
||||
Henning Diedrich <hd@eonblast.com>
|
||||
Henning Diedrich <hd@eonblast.com> Drake Burroughs <wildfyre@hotmail.com>
|
||||
|
||||
Felix Lange <fjl@twurst.com>
|
||||
Felix Lange <fjl@twurst.com> <fjl@users.noreply.github.com>
|
||||
|
||||
Максим Чусовлянов <mchusovlianov@gmail.com>
|
||||
|
||||
Louis Holbrook <dev@holbrook.no>
|
||||
Louis Holbrook <dev@holbrook.no> <nolash@users.noreply.github.com>
|
||||
|
||||
Thomas Bocek <tom@tomp2p.net>
|
||||
|
||||
Victor Tran <vu.tran54@gmail.com>
|
||||
|
||||
Justin Drake <drakefjustin@gmail.com>
|
||||
|
||||
Frank Wang <eternnoir@gmail.com>
|
||||
|
||||
Gary Rong <garyrong0905@gmail.com>
|
||||
|
||||
Gavin Wood <i@gavwood.com>
|
||||
|
||||
Gregg Dourgarian <greggd@tempworks.com>
|
||||
|
||||
Guillaume Ballet <gballet@gmail.com>
|
||||
Guillaume Ballet <gballet@gmail.com> <3272758+gballet@users.noreply.github.com>
|
||||
|
||||
Guillaume Nicolas <guin56@gmail.com>
|
||||
|
||||
Hanjiang Yu <delacroix.yu@gmail.com>
|
||||
Hanjiang Yu <delacroix.yu@gmail.com> <42531996+de1acr0ix@users.noreply.github.com>
|
||||
|
||||
Heiko Hees <heiko@heiko.org>
|
||||
|
||||
Henning Diedrich <hd@eonblast.com>
|
||||
Henning Diedrich <hd@eonblast.com> Drake Burroughs <wildfyre@hotmail.com>
|
||||
|
||||
Hwanjo Heo <34005989+hwanjo@users.noreply.github.com>
|
||||
|
||||
Iskander (Alex) Sharipov <quasilyte@gmail.com>
|
||||
Iskander (Alex) Sharipov <quasilyte@gmail.com> <i.sharipov@corp.vk.com>
|
||||
|
||||
Jae Kwon <jkwon.work@gmail.com>
|
||||
|
||||
Janoš Guljaš <janos@resenje.org> <janos@users.noreply.github.com>
|
||||
Janoš Guljaš <janos@resenje.org> Janos Guljas <janos@resenje.org>
|
||||
|
||||
Jared Wasinger <j-wasinger@hotmail.com>
|
||||
|
||||
Jason Carver <jacarver@linkedin.com>
|
||||
Jason Carver <jacarver@linkedin.com> <ut96caarrs@snkmail.com>
|
||||
|
||||
Javier Peletier <jm@epiclabs.io>
|
||||
Javier Peletier <jm@epiclabs.io> <jpeletier@users.noreply.github.com>
|
||||
|
||||
Jeffrey Wilcke <jeffrey@ethereum.org>
|
||||
Jeffrey Wilcke <jeffrey@ethereum.org> <geffobscura@gmail.com>
|
||||
Jeffrey Wilcke <jeffrey@ethereum.org> <obscuren@obscura.com>
|
||||
Jeffrey Wilcke <jeffrey@ethereum.org> <obscuren@users.noreply.github.com>
|
||||
|
||||
Jens Agerberg <github@agerberg.me>
|
||||
|
||||
Joseph Chow <ethereum@outlook.com>
|
||||
Joseph Chow <ethereum@outlook.com> ethers <TODO>
|
||||
|
||||
|
||||
Joseph Goulden <joegoulden@gmail.com>
|
||||
|
||||
Justin Drake <drakefjustin@gmail.com>
|
||||
|
||||
Kenso Trabing <ktrabing@acm.org>
|
||||
Kenso Trabing <ktrabing@acm.org> <kenso.trabing@bloomwebsite.com>
|
||||
|
||||
Liang Ma <liangma@liangbit.com>
|
||||
Liang Ma <liangma@liangbit.com> <liangma.ul@gmail.com>
|
||||
|
||||
Louis Holbrook <dev@holbrook.no>
|
||||
Louis Holbrook <dev@holbrook.no> <nolash@users.noreply.github.com>
|
||||
|
||||
Maran Hidskes <maran.hidskes@gmail.com>
|
||||
|
||||
Marian Oancea <contact@siteshop.ro>
|
||||
|
||||
Martin Becze <mjbecze@gmail.com>
|
||||
Martin Becze <mjbecze@gmail.com> <wanderer@users.noreply.github.com>
|
||||
|
||||
Martin Lundfall <martin.lundfall@protonmail.com>
|
||||
|
||||
Matt Garnett <14004106+lightclient@users.noreply.github.com>
|
||||
|
||||
Matthew Halpern <matthalp@gmail.com>
|
||||
Matthew Halpern <matthalp@gmail.com> <matthalp@google.com>
|
||||
|
||||
Michael Riabzev <michael@starkware.co>
|
||||
|
||||
Nchinda Nchinda <nchinda2@gmail.com>
|
||||
|
||||
Nick Dodson <silentcicero@outlook.com>
|
||||
|
||||
Nick Johnson <arachnid@notdot.net>
|
||||
|
||||
Nick Savers <nicksavers@gmail.com>
|
||||
|
||||
Nishant Das <nishdas93@gmail.com>
|
||||
Nishant Das <nishdas93@gmail.com> <nish1993@hotmail.com>
|
||||
|
||||
Olivier Hervieu <olivier.hervieu@gmail.com>
|
||||
|
||||
Pascal Dierich <pascal@merkleplant.xyz>
|
||||
Pascal Dierich <pascal@merkleplant.xyz> <pascal@pascaldierich.com>
|
||||
|
||||
RJ Catalano <catalanor0220@gmail.com>
|
||||
RJ Catalano <catalanor0220@gmail.com> <rj@erisindustries.com>
|
||||
|
||||
Ralph Caraveo <deckarep@gmail.com>
|
||||
|
||||
Rene Lubov <41963722+renaynay@users.noreply.github.com>
|
||||
|
||||
Robert Zaremba <robert@zaremba.ch>
|
||||
Robert Zaremba <robert@zaremba.ch> <robert.zaremba@scale-it.pl>
|
||||
|
||||
Roman Mandeleil <roman.mandeleil@gmail.com>
|
||||
|
||||
Sorin Neacsu <sorin.neacsu@gmail.com>
|
||||
Sorin Neacsu <sorin.neacsu@gmail.com> <sorin@users.noreply.github.com>
|
||||
|
||||
Sven Ehlert <sven@ethdev.com>
|
||||
|
||||
Taylor Gerring <taylor.gerring@gmail.com>
|
||||
Taylor Gerring <taylor.gerring@gmail.com> <taylor.gerring@ethereum.org>
|
||||
|
||||
Thomas Bocek <tom@tomp2p.net>
|
||||
|
||||
Tim Cooijmans <timcooijmans@gmail.com>
|
||||
|
||||
Valentin Wüstholz <wuestholz@gmail.com>
|
||||
Valentin Wüstholz <wuestholz@gmail.com> <wuestholz@users.noreply.github.com>
|
||||
|
||||
Victor Tran <vu.tran54@gmail.com>
|
||||
Armin Braun <me@obrown.io>
|
||||
|
||||
Viktor Trón <viktor.tron@gmail.com>
|
||||
|
||||
Ville Sundell <github@solarius.fi>
|
||||
|
||||
Vincent G <caktux@gmail.com>
|
||||
|
||||
Vitalik Buterin <v@buterin.com>
|
||||
|
||||
Vlad Gluhovsky <gluk256@gmail.com>
|
||||
Vlad Gluhovsky <gluk256@gmail.com> <gluk256@users.noreply.github.com>
|
||||
|
||||
Wenshao Zhong <wzhong20@uic.edu>
|
||||
Wenshao Zhong <wzhong20@uic.edu> <11510383@mail.sustc.edu.cn>
|
||||
Wenshao Zhong <wzhong20@uic.edu> <374662347@qq.com>
|
||||
|
||||
Will Villanueva <hello@willvillanueva.com>
|
||||
|
||||
Xiaobing Jiang <s7v7nislands@gmail.com>
|
||||
|
||||
Xudong Liu <33193253+r1cs@users.noreply.github.com>
|
||||
|
||||
Yohann Léon <sybiload@gmail.com>
|
||||
|
||||
Zachinquarantine <Zachinquarantine@protonmail.com>
|
||||
Zachinquarantine <Zachinquarantine@protonmail.com> <zachinquarantine@yahoo.com>
|
||||
|
||||
Ziyuan Zhong <zzy.albert@163.com>
|
||||
|
||||
Zsolt Felföldi <zsfelfoldi@gmail.com>
|
||||
|
||||
meowsbits <b5c6@protonmail.com>
|
||||
meowsbits <b5c6@protonmail.com> <45600330+meowsbits@users.noreply.github.com>
|
||||
|
||||
nedifi <103940716+nedifi@users.noreply.github.com>
|
||||
|
||||
Максим Чусовлянов <mchusovlianov@gmail.com>
|
||||
Ernesto del Toro <ernesto.deltoro@gmail.com>
|
||||
Ernesto del Toro <ernesto.deltoro@gmail.com> <ernestodeltoro@users.noreply.github.com>
|
||||
|
||||
260
AUTHORS
260
AUTHORS
@@ -1,46 +1,27 @@
|
||||
# This is the official list of go-ethereum authors for copyright purposes.
|
||||
|
||||
6543 <6543@obermui.de>
|
||||
a e r t h <aerth@users.noreply.github.com>
|
||||
Aaron Buchwald <aaron.buchwald56@gmail.com>
|
||||
Abel Nieto <abel.nieto90@gmail.com>
|
||||
Abel Nieto <anietoro@uwaterloo.ca>
|
||||
Adam Babik <a.babik@designfortress.com>
|
||||
Adam Schmideg <adamschmideg@users.noreply.github.com>
|
||||
Aditya <adityasripal@gmail.com>
|
||||
Aditya Arora <arora.aditya520@gmail.com>
|
||||
Adrià Cidre <adria.cidre@gmail.com>
|
||||
Afanasii Kurakin <afanasy@users.noreply.github.com>
|
||||
Afri Schoedon <5chdn@users.noreply.github.com>
|
||||
Agustin Armellini Fischer <armellini13@gmail.com>
|
||||
Ahyun <urbanart2251@gmail.com>
|
||||
Airead <fgh1987168@gmail.com>
|
||||
Alan Chen <alanchchen@users.noreply.github.com>
|
||||
Alejandro Isaza <alejandro.isaza@gmail.com>
|
||||
Aleksey Smyrnov <i@soar.name>
|
||||
Ales Katona <ales@coinbase.com>
|
||||
Alex Beregszaszi <alex@rtfs.hu>
|
||||
Alex Leverington <alex@ethdev.com>
|
||||
Alex Mazalov <mazalov@gmail.com>
|
||||
Alex Pozhilenkov <alex_pozhilenkov@adoriasoft.com>
|
||||
Alex Prut <1648497+alexprut@users.noreply.github.com>
|
||||
Alex Wu <wuyiding@gmail.com>
|
||||
Alexander van der Meij <alexandervdm@users.noreply.github.com>
|
||||
Alexander Yastrebov <yastrebov.alex@gmail.com>
|
||||
Alexandre Van de Sande <alex.vandesande@ethdev.com>
|
||||
Alexey Akhunov <akhounov@gmail.com>
|
||||
Alexey Shekhirin <a.shekhirin@gmail.com>
|
||||
alexwang <39109351+dipingxian2@users.noreply.github.com>
|
||||
Ali Atiia <42751398+aliatiia@users.noreply.github.com>
|
||||
Ali Hajimirza <Ali92hm@users.noreply.github.com>
|
||||
am2rican5 <am2rican5@gmail.com>
|
||||
AmitBRD <60668103+AmitBRD@users.noreply.github.com>
|
||||
Anatole <62328077+a2br@users.noreply.github.com>
|
||||
Andrea Franz <andrea@gravityblast.com>
|
||||
Andrei Maiboroda <andrei@ethereum.org>
|
||||
Andrey Petrov <andrey.petrov@shazow.net>
|
||||
Andrey Petrov <shazow@gmail.com>
|
||||
ANOTHEL <anothel1@naver.com>
|
||||
Antoine Rondelet <rondelet.antoine@gmail.com>
|
||||
Antoine Toulme <atoulme@users.noreply.github.com>
|
||||
Anton Evangelatov <anton.evangelatov@gmail.com>
|
||||
Antonio Salazar Cardozo <savedfastcool@gmail.com>
|
||||
Arba Sasmoyo <arba.sasmoyo@gmail.com>
|
||||
@@ -48,26 +29,19 @@ Armani Ferrante <armaniferrante@berkeley.edu>
|
||||
Armin Braun <me@obrown.io>
|
||||
Aron Fischer <github@aron.guru>
|
||||
atsushi-ishibashi <atsushi.ishibashi@finatext.com>
|
||||
Austin Roberts <code@ausiv.com>
|
||||
ayeowch <ayeowch@gmail.com>
|
||||
b00ris <b00ris@mail.ru>
|
||||
b1ackd0t <blackd0t@protonmail.com>
|
||||
bailantaotao <Edwin@maicoin.com>
|
||||
baizhenxuan <nkbai@163.com>
|
||||
Balaji Shetty Pachai <32358081+balajipachai@users.noreply.github.com>
|
||||
Balint Gabor <balint.g@gmail.com>
|
||||
baptiste-b-pegasys <85155432+baptiste-b-pegasys@users.noreply.github.com>
|
||||
Bas van Kervel <bas@ethdev.com>
|
||||
Benjamin Brent <benjamin@benjaminbrent.com>
|
||||
benma <mbencun@gmail.com>
|
||||
Benoit Verkindt <benoit.verkindt@gmail.com>
|
||||
Binacs <bin646891055@gmail.com>
|
||||
bloonfield <bloonfield@163.com>
|
||||
Bo <bohende@gmail.com>
|
||||
Bo Ye <boy.e.computer.1982@outlook.com>
|
||||
Bob Glickstein <bobg@users.noreply.github.com>
|
||||
Boqin Qin <bobbqqin@bupt.edu.cn>
|
||||
Brandon Harden <b.harden92@gmail.com>
|
||||
Brent <bmperrea@gmail.com>
|
||||
Brian Schroeder <bts@gmail.com>
|
||||
Bruno Škvorc <bruno@skvorc.me>
|
||||
@@ -75,58 +49,36 @@ C. Brown <hackdom@majoolr.io>
|
||||
Caesar Chad <BLUE.WEB.GEEK@gmail.com>
|
||||
Casey Detrio <cdetrio@gmail.com>
|
||||
CDsigma <cdsigma271@gmail.com>
|
||||
Ceelog <chenwei@ceelog.org>
|
||||
Ceyhun Onur <ceyhun.onur@avalabs.org>
|
||||
chabashilah <doumodoumo@gmail.com>
|
||||
changhong <changhong.yu@shanbay.com>
|
||||
Chase Wright <mysticryuujin@gmail.com>
|
||||
Chen Quan <terasum@163.com>
|
||||
Cheng Li <lob4tt@gmail.com>
|
||||
chenglin <910372762@qq.com>
|
||||
chenyufeng <yufengcode@gmail.com>
|
||||
Chris Pacia <ctpacia@gmail.com>
|
||||
Chris Ziogas <ziogaschr@gmail.com>
|
||||
Christian Muehlhaeuser <muesli@gmail.com>
|
||||
Christoph Jentzsch <jentzsch.software@gmail.com>
|
||||
chuwt <weitaochu@gmail.com>
|
||||
cong <ackratos@users.noreply.github.com>
|
||||
Connor Stein <connor.stein@mail.mcgill.ca>
|
||||
Corey Lin <514971757@qq.com>
|
||||
courtier <derinilter@gmail.com>
|
||||
cpusoft <cpusoft@live.com>
|
||||
Crispin Flowerday <crispin@bitso.com>
|
||||
croath <croathliu@gmail.com>
|
||||
cui <523516579@qq.com>
|
||||
Dan DeGreef <dan.degreef@gmail.com>
|
||||
Dan Kinsley <dan@joincivil.com>
|
||||
Dan Sosedoff <dan.sosedoff@gmail.com>
|
||||
Daniel A. Nagy <nagy.da@gmail.com>
|
||||
Daniel Perez <daniel@perez.sh>
|
||||
Daniel Sloof <goapsychadelic@gmail.com>
|
||||
Darioush Jalali <darioush.jalali@avalabs.org>
|
||||
Darrel Herbst <dherbst@gmail.com>
|
||||
Dave Appleton <calistralabs@gmail.com>
|
||||
Dave McGregor <dave.s.mcgregor@gmail.com>
|
||||
David Cai <davidcai1993@yahoo.com>
|
||||
David Huie <dahuie@gmail.com>
|
||||
Denver <aeharvlee@gmail.com>
|
||||
Derek Chiang <me@derekchiang.com>
|
||||
Derek Gottfrid <derek@codecubed.com>
|
||||
Di Peng <pendyaaa@gmail.com>
|
||||
Diederik Loerakker <proto@protolambda.com>
|
||||
Diego Siqueira <DiSiqueira@users.noreply.github.com>
|
||||
Diep Pham <mrfavadi@gmail.com>
|
||||
dipingxian2 <39109351+dipingxian2@users.noreply.github.com>
|
||||
divergencetech <94644849+divergencetech@users.noreply.github.com>
|
||||
dm4 <sunrisedm4@gmail.com>
|
||||
Dmitrij Koniajev <dimchansky@gmail.com>
|
||||
Dmitry Shulyak <yashulyak@gmail.com>
|
||||
Dmitry Zenovich <dzenovich@gmail.com>
|
||||
Domino Valdano <dominoplural@gmail.com>
|
||||
Domino Valdano <jeff@okcupid.com>
|
||||
Dragan Milic <dragan@netice9.com>
|
||||
dragonvslinux <35779158+dragononcrypto@users.noreply.github.com>
|
||||
Edgar Aroutiounian <edgar.factorial@gmail.com>
|
||||
Eduard S <eduardsanou@posteo.net>
|
||||
Egon Elbre <egonelbre@gmail.com>
|
||||
Elad <theman@elad.im>
|
||||
Eli <elihanover@yahoo.com>
|
||||
@@ -134,189 +86,131 @@ Elias Naur <elias.naur@gmail.com>
|
||||
Elliot Shepherd <elliot@identitii.com>
|
||||
Emil <mursalimovemeel@gmail.com>
|
||||
emile <emile@users.noreply.github.com>
|
||||
Emmanuel T Odeke <odeke@ualberta.ca>
|
||||
Eng Zer Jun <engzerjun@gmail.com>
|
||||
Enrique Fynn <enriquefynn@gmail.com>
|
||||
Enrique Fynn <me@enriquefynn.com>
|
||||
Enrique Ortiz <hi@enriqueortiz.dev>
|
||||
EOS Classic <info@eos-classic.io>
|
||||
Erichin <erichinbato@gmail.com>
|
||||
Ernesto del Toro <ernesto.deltoro@gmail.com>
|
||||
Ethan Buchman <ethan@coinculture.info>
|
||||
ethersphere <thesw@rm.eth>
|
||||
Eugene Lepeico <eugenelepeico@gmail.com>
|
||||
Eugene Valeyev <evgen.povt@gmail.com>
|
||||
Evangelos Pappas <epappas@evalonlabs.com>
|
||||
Everton Fraga <ev@ethereum.org>
|
||||
Evgeny <awesome.observer@yandex.com>
|
||||
Evgeny Danilenko <6655321@bk.ru>
|
||||
evgk <evgeniy.kamyshev@gmail.com>
|
||||
Evolution404 <35091674+Evolution404@users.noreply.github.com>
|
||||
EXEC <execvy@gmail.com>
|
||||
Fabian Vogelsteller <fabian@frozeman.de>
|
||||
Fabio Barone <fabio.barone.co@gmail.com>
|
||||
Fabio Berger <fabioberger1991@gmail.com>
|
||||
FaceHo <facehoshi@gmail.com>
|
||||
Felipe Strozberg <48066928+FelStroz@users.noreply.github.com>
|
||||
Felix Lange <fjl@twurst.com>
|
||||
Ferenc Szabo <frncmx@gmail.com>
|
||||
ferhat elmas <elmas.ferhat@gmail.com>
|
||||
Ferran Borreguero <ferranbt@protonmail.com>
|
||||
Fiisio <liangcszzu@163.com>
|
||||
Fire Man <55934298+basdevelop@users.noreply.github.com>
|
||||
flowerofdream <775654398@qq.com>
|
||||
fomotrader <82184770+fomotrader@users.noreply.github.com>
|
||||
ForLina <471133417@qq.com>
|
||||
Frank Szendzielarz <33515470+FrankSzendzielarz@users.noreply.github.com>
|
||||
Frank Wang <eternnoir@gmail.com>
|
||||
Franklin <mr_franklin@126.com>
|
||||
Furkan KAMACI <furkankamaci@gmail.com>
|
||||
Fuyang Deng <dengfuyang@outlook.com>
|
||||
GagziW <leon.stanko@rwth-aachen.de>
|
||||
Gary Rong <garyrong0905@gmail.com>
|
||||
Gautam Botrel <gautam.botrel@gmail.com>
|
||||
George Ornbo <george@shapeshed.com>
|
||||
Giuseppe Bertone <bertone.giuseppe@gmail.com>
|
||||
Greg Colvin <greg@colvin.org>
|
||||
Gregg Dourgarian <greggd@tempworks.com>
|
||||
Gregory Markou <16929357+GregTheGreek@users.noreply.github.com>
|
||||
Guifel <toowik@gmail.com>
|
||||
Guilherme Salgado <gsalgado@gmail.com>
|
||||
Guillaume Ballet <gballet@gmail.com>
|
||||
Guillaume Nicolas <guin56@gmail.com>
|
||||
GuiltyMorishita <morilliantblue@gmail.com>
|
||||
Guruprasad Kamath <48196632+gurukamath@users.noreply.github.com>
|
||||
Gus <yo@soygus.com>
|
||||
Gustav Simonsson <gustav.simonsson@gmail.com>
|
||||
Gísli Kristjánsson <gislik@hamstur.is>
|
||||
Ha ĐANG <dvietha@gmail.com>
|
||||
HackyMiner <hackyminer@gmail.com>
|
||||
hadv <dvietha@gmail.com>
|
||||
Hanjiang Yu <delacroix.yu@gmail.com>
|
||||
Hao Bryan Cheng <haobcheng@gmail.com>
|
||||
Hao Duan <duanhao0814@gmail.com>
|
||||
HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
|
||||
Harry Dutton <me@bytejedi.com>
|
||||
haryu703 <34744512+haryu703@users.noreply.github.com>
|
||||
Hendrik Hofstadt <hendrik@nexantic.com>
|
||||
Henning Diedrich <hd@eonblast.com>
|
||||
henopied <13500516+henopied@users.noreply.github.com>
|
||||
hero5512 <lvshuaino@gmail.com>
|
||||
holisticode <holistic.computing@gmail.com>
|
||||
Hongbin Mao <hello2mao@gmail.com>
|
||||
Hsien-Tang Kao <htkao@pm.me>
|
||||
hsyodyssey <47173566+hsyodyssey@users.noreply.github.com>
|
||||
Husam Ibrahim <39692071+HusamIbrahim@users.noreply.github.com>
|
||||
Hwanjo Heo <34005989+hwanjo@users.noreply.github.com>
|
||||
hydai <z54981220@gmail.com>
|
||||
Hyung-Kyu Hqueue Choi <hyungkyu.choi@gmail.com>
|
||||
Håvard Anda Estensen <haavard.ae@gmail.com>
|
||||
Ian Macalinao <me@ian.pw>
|
||||
Ian Norden <iannordenn@gmail.com>
|
||||
icodezjb <icodezjb@163.com>
|
||||
Ikko Ashimine <eltociear@gmail.com>
|
||||
Ilan Gitter <8359193+gitteri@users.noreply.github.com>
|
||||
ImanSharaf <78227895+ImanSharaf@users.noreply.github.com>
|
||||
Isidoro Ghezzi <isidoro.ghezzi@icloud.com>
|
||||
Iskander (Alex) Sharipov <quasilyte@gmail.com>
|
||||
Ivan Bogatyy <bogatyi@gmail.com>
|
||||
Ivan Daniluk <ivan.daniluk@gmail.com>
|
||||
Ivo Georgiev <ivo@strem.io>
|
||||
jacksoom <lifengliu1994@gmail.com>
|
||||
Jae Kwon <jkwon.work@gmail.com>
|
||||
James Prestwich <10149425+prestwich@users.noreply.github.com>
|
||||
Jamie Pitts <james.pitts@gmail.com>
|
||||
Janoš Guljaš <janos@resenje.org>
|
||||
Jared Wasinger <j-wasinger@hotmail.com>
|
||||
Janos Guljas <janos@resenje.org>
|
||||
Janoš Guljaš <janos@users.noreply.github.com>
|
||||
Jason Carver <jacarver@linkedin.com>
|
||||
Javier Peletier <jm@epiclabs.io>
|
||||
Javier Peletier <jpeletier@users.noreply.github.com>
|
||||
Javier Sagredo <jasataco@gmail.com>
|
||||
Jay <codeholic.arena@gmail.com>
|
||||
Jay Guo <guojiannan1101@gmail.com>
|
||||
Jaynti Kanani <jdkanani@gmail.com>
|
||||
Jeff Prestes <jeffprestes@gmail.com>
|
||||
Jeff R. Allen <jra@nella.org>
|
||||
Jeff Wentworth <jeff@curvegrid.com>
|
||||
Jeffery Robert Walsh <rlxrlps@gmail.com>
|
||||
Jeffrey Wilcke <jeffrey@ethereum.org>
|
||||
Jens Agerberg <github@agerberg.me>
|
||||
Jeremy McNevin <jeremy.mcnevin@optum.com>
|
||||
Jeremy Schlatter <jeremy.schlatter@gmail.com>
|
||||
Jerzy Lasyk <jerzylasyk@gmail.com>
|
||||
Jesse Tane <jesse.tane@gmail.com>
|
||||
Jia Chenhui <jiachenhui1989@gmail.com>
|
||||
Jim McDonald <Jim@mcdee.net>
|
||||
jk-jeongkyun <45347815+jeongkyun-oh@users.noreply.github.com>
|
||||
jkcomment <jkcomment@gmail.com>
|
||||
JoeGruffins <34998433+JoeGruffins@users.noreply.github.com>
|
||||
Joel Burget <joelburget@gmail.com>
|
||||
John C. Vernaleo <john@netpurgatory.com>
|
||||
John Difool <johndifoolpi@gmail.com>
|
||||
Johns Beharry <johns@peakshift.com>
|
||||
Jonas <felberj@users.noreply.github.com>
|
||||
Jonathan Brown <jbrown@bluedroplet.com>
|
||||
Jonathan Chappelow <chappjc@users.noreply.github.com>
|
||||
Jonathan Gimeno <jgimeno@gmail.com>
|
||||
JoranHonig <JoranHonig@users.noreply.github.com>
|
||||
Jordan Krage <jmank88@gmail.com>
|
||||
Jorropo <jorropo.pgm@gmail.com>
|
||||
Joseph Chow <ethereum@outlook.com>
|
||||
Joshua Colvin <jcolvin@offchainlabs.com>
|
||||
Joshua Gutow <jbgutow@gmail.com>
|
||||
jovijovi <mageyul@hotmail.com>
|
||||
jtakalai <juuso.takalainen@streamr.com>
|
||||
JU HYEONG PARK <dkdkajej@gmail.com>
|
||||
Julian Y <jyap808@users.noreply.github.com>
|
||||
Justin Clark-Casey <justincc@justincc.org>
|
||||
Justin Drake <drakefjustin@gmail.com>
|
||||
Justus <jus@gtsbr.org>
|
||||
Kawashima <91420903+sscodereth@users.noreply.github.com>
|
||||
jwasinger <j-wasinger@hotmail.com>
|
||||
ken10100147 <sunhongping@kanjian.com>
|
||||
Kenji Siu <kenji@isuntv.com>
|
||||
Kenso Trabing <kenso.trabing@bloomwebsite.com>
|
||||
Kenso Trabing <ktrabing@acm.org>
|
||||
Kevin <denk.kevin@web.de>
|
||||
kevin.xu <cming.xu@gmail.com>
|
||||
KibGzr <kibgzr@gmail.com>
|
||||
kiel barry <kiel.j.barry@gmail.com>
|
||||
kilic <onurkilic1004@gmail.com>
|
||||
kimmylin <30611210+kimmylin@users.noreply.github.com>
|
||||
Kitten King <53072918+kittenking@users.noreply.github.com>
|
||||
knarfeh <hejun1874@gmail.com>
|
||||
Kobi Gurkan <kobigurk@gmail.com>
|
||||
komika <komika@komika.org>
|
||||
Konrad Feldmeier <konrad@brainbot.com>
|
||||
Kris Shinn <raggamuffin.music@gmail.com>
|
||||
Kristofer Peterson <svenski123@users.noreply.github.com>
|
||||
Kumar Anirudha <mail@anirudha.dev>
|
||||
Kurkó Mihály <kurkomisi@users.noreply.github.com>
|
||||
Kushagra Sharma <ksharm01@gmail.com>
|
||||
Kwuaint <34888408+kwuaint@users.noreply.github.com>
|
||||
Kyuntae Ethan Kim <ethan.kyuntae.kim@gmail.com>
|
||||
Lee Bousfield <ljbousfield@gmail.com>
|
||||
ledgerwatch <akhounov@gmail.com>
|
||||
Lefteris Karapetsas <lefteris@refu.co>
|
||||
Leif Jurvetson <leijurv@gmail.com>
|
||||
Leo Shklovskii <leo@thermopylae.net>
|
||||
LeoLiao <leofantast@gmail.com>
|
||||
Lewis Marshall <lewis@lmars.net>
|
||||
lhendre <lhendre2@gmail.com>
|
||||
Li Dongwei <lidw1988@126.com>
|
||||
Liang Ma <liangma.ul@gmail.com>
|
||||
Liang Ma <liangma@liangbit.com>
|
||||
Liang ZOU <liang.d.zou@gmail.com>
|
||||
libby kent <viskovitzzz@gmail.com>
|
||||
libotony <liboliqi@gmail.com>
|
||||
LieutenantRoger <dijsky_2015@hotmail.com>
|
||||
ligi <ligi@ligi.de>
|
||||
Lio李欧 <lionello@users.noreply.github.com>
|
||||
lmittmann <lmittmann@users.noreply.github.com>
|
||||
Lorenzo Manacorda <lorenzo@kinvolk.io>
|
||||
Louis Holbrook <dev@holbrook.no>
|
||||
Luca Zeug <luclu@users.noreply.github.com>
|
||||
Lucas Hendren <lhendre2@gmail.com>
|
||||
lzhfromustc <43191155+lzhfromustc@users.noreply.github.com>
|
||||
Magicking <s@6120.eu>
|
||||
manlio <manlio.poltronieri@gmail.com>
|
||||
Maran Hidskes <maran.hidskes@gmail.com>
|
||||
Marek Kotewicz <marek.kotewicz@gmail.com>
|
||||
Mariano Cortesi <mcortesi@gmail.com>
|
||||
Marius van der Wijden <m.vanderwijden@live.de>
|
||||
Mark <markya0616@gmail.com>
|
||||
Mark Rushakoff <mark.rushakoff@gmail.com>
|
||||
@@ -324,193 +218,108 @@ mark.lin <mark@maicoin.com>
|
||||
Martin Alex Philip Dawson <u1356770@gmail.com>
|
||||
Martin Holst Swende <martin@swende.se>
|
||||
Martin Klepsch <martinklepsch@googlemail.com>
|
||||
Martin Lundfall <martin.lundfall@protonmail.com>
|
||||
Martin Michlmayr <tbm@cyrius.com>
|
||||
Martin Redmond <21436+reds@users.noreply.github.com>
|
||||
Mason Fischer <mason@kissr.co>
|
||||
Mateusz Morusiewicz <11313015+Ruteri@users.noreply.github.com>
|
||||
Mats Julian Olsen <mats@plysjbyen.net>
|
||||
Matt Garnett <14004106+lightclient@users.noreply.github.com>
|
||||
Matt K <1036969+mkrump@users.noreply.github.com>
|
||||
Matthew Di Ferrante <mattdf@users.noreply.github.com>
|
||||
Matthew Halpern <matthalp@gmail.com>
|
||||
Matthew Halpern <matthalp@google.com>
|
||||
Matthew Wampler-Doty <matthew.wampler.doty@gmail.com>
|
||||
Max Sistemich <mafrasi2@googlemail.com>
|
||||
Maxim Zhiburt <zhiburt@gmail.com>
|
||||
Maximilian Meister <mmeister@suse.de>
|
||||
me020523 <me020523@gmail.com>
|
||||
Melvin Junhee Woo <melvin.woo@groundx.xyz>
|
||||
meowsbits <b5c6@protonmail.com>
|
||||
Micah Zoltu <micah@zoltu.net>
|
||||
Michael Forney <mforney@mforney.org>
|
||||
Michael Riabzev <michael@starkware.co>
|
||||
Michael Ruminer <michael.ruminer+github@gmail.com>
|
||||
michael1011 <me@michael1011.at>
|
||||
Miguel Mota <miguelmota2@gmail.com>
|
||||
Mike Burr <mburr@nightmare.com>
|
||||
Mikhail Mikheev <mmvsha73@gmail.com>
|
||||
milesvant <milesvant@gmail.com>
|
||||
Miro <mirokuratczyk@users.noreply.github.com>
|
||||
Miya Chen <miyatlchen@gmail.com>
|
||||
Mohanson <mohanson@outlook.com>
|
||||
mr_franklin <mr_franklin@126.com>
|
||||
Mudit Gupta <guptamudit@ymail.com>
|
||||
Mymskmkt <1847234666@qq.com>
|
||||
Nalin Bhardwaj <nalinbhardwaj@nibnalin.me>
|
||||
Natsu Kagami <natsukagami@gmail.com>
|
||||
Nchinda Nchinda <nchinda2@gmail.com>
|
||||
nebojsa94 <nebojsa94@users.noreply.github.com>
|
||||
necaremus <necaremus@gmail.com>
|
||||
nedifi <103940716+nedifi@users.noreply.github.com>
|
||||
needkane <604476380@qq.com>
|
||||
Nguyen Kien Trung <trung.n.k@gmail.com>
|
||||
Nguyen Sy Thanh Son <thanhson1085@gmail.com>
|
||||
Nic Jansma <nic@nicj.net>
|
||||
Nick Dodson <silentcicero@outlook.com>
|
||||
Nick Johnson <arachnid@notdot.net>
|
||||
Nicolas Feignon <nfeignon@gmail.com>
|
||||
Nicolas Guillaume <gunicolas@sqli.com>
|
||||
Nikita Kozhemyakin <enginegl.ec@gmail.com>
|
||||
Nikola Madjarevic <nikola.madjarevic@gmail.com>
|
||||
Nilesh Trivedi <nilesh@hypertrack.io>
|
||||
Nimrod Gutman <nimrod.gutman@gmail.com>
|
||||
Nishant Das <nishdas93@gmail.com>
|
||||
njupt-moon <1015041018@njupt.edu.cn>
|
||||
nkbai <nkbai@163.com>
|
||||
noam-alchemy <76969113+noam-alchemy@users.noreply.github.com>
|
||||
nobody <ddean2009@163.com>
|
||||
Noman <noman@noman.land>
|
||||
nujabes403 <nujabes403@gmail.com>
|
||||
Nye Liu <nyet@nyet.org>
|
||||
Oleg Kovalov <iamolegkovalov@gmail.com>
|
||||
Oli Bye <olibye@users.noreply.github.com>
|
||||
Oliver Tale-Yazdi <oliver@perun.network>
|
||||
Olivier Hervieu <olivier.hervieu@gmail.com>
|
||||
Or Neeman <oneeman@gmail.com>
|
||||
Osoro Bironga <fanosoro@gmail.com>
|
||||
Osuke <arget-fee.free.dgm@hotmail.co.jp>
|
||||
Pantelis Peslis <pespantelis@gmail.com>
|
||||
Pascal Dierich <pascal@merkleplant.xyz>
|
||||
Patrick O'Grady <prohb125@gmail.com>
|
||||
Pau <pau@dabax.net>
|
||||
Paul Berg <hello@paulrberg.com>
|
||||
Paul Litvak <litvakpol@012.net.il>
|
||||
Paul-Armand Verhaegen <paularmand.verhaegen@gmail.com>
|
||||
Paulo L F Casaretto <pcasaretto@gmail.com>
|
||||
Paweł Bylica <chfast@gmail.com>
|
||||
Pedro Gomes <otherview@gmail.com>
|
||||
Pedro Pombeiro <PombeirP@users.noreply.github.com>
|
||||
Peter Broadhurst <peter@themumbles.net>
|
||||
peter cresswell <pcresswell@gmail.com>
|
||||
Peter Pratscher <pratscher@gmail.com>
|
||||
Peter Simard <petesimard56@gmail.com>
|
||||
Petr Mikusek <petr@mikusek.info>
|
||||
Philip Schlump <pschlump@gmail.com>
|
||||
Pierre Neter <pierreneter@gmail.com>
|
||||
Pierre R <p.rousset@gmail.com>
|
||||
piersy <pierspowlesland@gmail.com>
|
||||
PilkyuJung <anothel1@naver.com>
|
||||
Piotr Dyraga <piotr.dyraga@keep.network>
|
||||
ploui <64719999+ploui@users.noreply.github.com>
|
||||
Preston Van Loon <preston@prysmaticlabs.com>
|
||||
Prince Sinha <sinhaprince013@gmail.com>
|
||||
protolambda <proto@protolambda.com>
|
||||
Péter Szilágyi <peterke@gmail.com>
|
||||
qd-ethan <31876119+qdgogogo@users.noreply.github.com>
|
||||
Qian Bin <cola.tin.com@gmail.com>
|
||||
Quest Henkart <qhenkart@gmail.com>
|
||||
Rachel Franks <nfranks@protonmail.com>
|
||||
Rafael Matias <rafael@skyle.net>
|
||||
Raghav Sood <raghavsood@gmail.com>
|
||||
Ralph Caraveo <deckarep@gmail.com>
|
||||
Ralph Caraveo III <deckarep@gmail.com>
|
||||
Ramesh Nair <ram@hiddentao.com>
|
||||
rangzen <public@l-homme.com>
|
||||
reinerRubin <tolstov.georgij@gmail.com>
|
||||
Rene Lubov <41963722+renaynay@users.noreply.github.com>
|
||||
rhaps107 <dod-source@yandex.ru>
|
||||
Ricardo Catalinas Jiménez <r@untroubled.be>
|
||||
Ricardo Domingos <ricardohsd@gmail.com>
|
||||
Richard Hart <richardhart92@gmail.com>
|
||||
Rick <rick.no@groundx.xyz>
|
||||
RJ Catalano <catalanor0220@gmail.com>
|
||||
Rob <robert@rojotek.com>
|
||||
Rob Mulholand <rmulholand@8thlight.com>
|
||||
Robert Zaremba <robert@zaremba.ch>
|
||||
Robert Zaremba <robert.zaremba@scale-it.pl>
|
||||
Roc Yu <rociiu0112@gmail.com>
|
||||
Roman Mazalov <83914728+gopherxyz@users.noreply.github.com>
|
||||
Ross <9055337+Chadsr@users.noreply.github.com>
|
||||
Runchao Han <elvisage941102@gmail.com>
|
||||
Russ Cox <rsc@golang.org>
|
||||
Ryan Schneider <ryanleeschneider@gmail.com>
|
||||
ryanc414 <ryan@tokencard.io>
|
||||
Rémy Roy <remyroy@remyroy.com>
|
||||
S. Matthew English <s-matthew-english@users.noreply.github.com>
|
||||
salanfe <salanfe@users.noreply.github.com>
|
||||
Sam <39165351+Xia-Sam@users.noreply.github.com>
|
||||
Sammy Libre <7374093+sammy007@users.noreply.github.com>
|
||||
Samuel Marks <samuelmarks@gmail.com>
|
||||
sanskarkhare <sanskarkhare47@gmail.com>
|
||||
Sarlor <kinsleer@outlook.com>
|
||||
Sasuke1964 <neilperry1964@gmail.com>
|
||||
Satpal <28562234+SatpalSandhu61@users.noreply.github.com>
|
||||
Saulius Grigaitis <saulius@necolt.com>
|
||||
Sean <darcys22@gmail.com>
|
||||
Serhat Şevki Dinçer <jfcgauss@gmail.com>
|
||||
Shane Bammel <sjb933@gmail.com>
|
||||
shawn <36943337+lxex@users.noreply.github.com>
|
||||
shigeyuki azuchi <azuchi@chaintope.com>
|
||||
Shihao Xia <charlesxsh@hotmail.com>
|
||||
Shiming <codingmylife@gmail.com>
|
||||
Sheldon <11510383@mail.sustc.edu.cn>
|
||||
Sheldon <374662347@qq.com>
|
||||
Shintaro Kaneko <kaneshin0120@gmail.com>
|
||||
shiqinfeng1 <150627601@qq.com>
|
||||
Shuai Qi <qishuai231@gmail.com>
|
||||
Shude Li <islishude@gmail.com>
|
||||
Shunsuke Watanabe <ww.shunsuke@gmail.com>
|
||||
silence <wangsai.silence@qq.com>
|
||||
Simon Jentzsch <simon@slock.it>
|
||||
Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
|
||||
sixdays <lj491685571@126.com>
|
||||
SjonHortensius <SjonHortensius@users.noreply.github.com>
|
||||
Slava Karpenko <slavikus@gmail.com>
|
||||
slumber1122 <slumber1122@gmail.com>
|
||||
Smilenator <yurivanenko@yandex.ru>
|
||||
soc1c <soc1c@users.noreply.github.com>
|
||||
Sorin Neacsu <sorin.neacsu@gmail.com>
|
||||
Sparty <vignesh.crysis@gmail.com>
|
||||
Stein Dekker <dekker.stein@gmail.com>
|
||||
Steve Gattuso <steve@stevegattuso.me>
|
||||
Steve Ruckdashel <steve.ruckdashel@gmail.com>
|
||||
Steve Waldman <swaldman@mchange.com>
|
||||
Steven E. Harris <seh@panix.com>
|
||||
Steven Roose <stevenroose@gmail.com>
|
||||
stompesi <stompesi@gmail.com>
|
||||
stormpang <jialinpeng@vip.qq.com>
|
||||
sunxiaojun2014 <sunxiaojun-xy@360.cn>
|
||||
Suriyaa Sundararuban <isc.suriyaa@gmail.com>
|
||||
Sylvain Laurent <s@6120.eu>
|
||||
Taeik Lim <sibera21@gmail.com>
|
||||
tamirms <tamir@trello.com>
|
||||
Tangui Clairet <tangui.clairet@gmail.com>
|
||||
Tatsuya Shimoda <tacoo@users.noreply.github.com>
|
||||
Taylor Gerring <taylor.gerring@gmail.com>
|
||||
TColl <38299499+TColl@users.noreply.github.com>
|
||||
terasum <terasum@163.com>
|
||||
tgyKomgo <52910426+tgyKomgo@users.noreply.github.com>
|
||||
Thad Guidry <thadguidry@gmail.com>
|
||||
Thomas Bocek <tom@tomp2p.net>
|
||||
thomasmodeneis <thomas.modeneis@gmail.com>
|
||||
thumb8432 <thumb8432@gmail.com>
|
||||
Ti Zhou <tizhou1986@gmail.com>
|
||||
tia-99 <67107070+tia-99@users.noreply.github.com>
|
||||
Tim Cooijmans <timcooijmans@gmail.com>
|
||||
Tobias Hildebrandt <79341166+tobias-hildebrandt@users.noreply.github.com>
|
||||
Tosh Camille <tochecamille@gmail.com>
|
||||
tsarpaul <Litvakpol@012.net.il>
|
||||
Tyler Chambers <2775339+tylerchambers@users.noreply.github.com>
|
||||
tzapu <alex@tzapu.com>
|
||||
ucwong <ucwong@126.com>
|
||||
uji <49834542+uji@users.noreply.github.com>
|
||||
ult-bobonovski <alex@ultiledger.io>
|
||||
Valentin Trinqué <ValentinTrinque@users.noreply.github.com>
|
||||
Valentin Wüstholz <wuestholz@gmail.com>
|
||||
Vedhavyas Singareddi <vedhavyas.singareddi@gmail.com>
|
||||
Victor Farazdagi <simple.square@gmail.com>
|
||||
@@ -521,71 +330,40 @@ Ville Sundell <github@solarius.fi>
|
||||
vim88 <vim88vim88@gmail.com>
|
||||
Vincent G <caktux@gmail.com>
|
||||
Vincent Serpoul <vincent@serpoul.com>
|
||||
Vinod Damle <vdamle@users.noreply.github.com>
|
||||
Vitalik Buterin <v@buterin.com>
|
||||
Vitaly Bogdanov <vsbogd@gmail.com>
|
||||
Vitaly V <vvelikodny@gmail.com>
|
||||
Vivek Anand <vivekanand1101@users.noreply.github.com>
|
||||
Vlad <gluk256@gmail.com>
|
||||
Vlad Bokov <razum2um@mail.ru>
|
||||
Vlad Gluhovsky <gluk256@gmail.com>
|
||||
Ward Bradt <wardbradt5@gmail.com>
|
||||
Water <44689567+codeoneline@users.noreply.github.com>
|
||||
wbt <wbt@users.noreply.github.com>
|
||||
Vlad Gluhovsky <gluk256@users.noreply.github.com>
|
||||
weimumu <934657014@qq.com>
|
||||
Wenbiao Zheng <delweng@gmail.com>
|
||||
Wenshao Zhong <wzhong20@uic.edu>
|
||||
Will Villanueva <hello@willvillanueva.com>
|
||||
William Morriss <wjmelements@gmail.com>
|
||||
William Setzer <bootstrapsetzer@gmail.com>
|
||||
williambannas <wrschwartz@wpi.edu>
|
||||
wuff1996 <33193253+wuff1996@users.noreply.github.com>
|
||||
Wuxiang <wuxiangzhou2010@gmail.com>
|
||||
Xiaobing Jiang <s7v7nislands@gmail.com>
|
||||
xiekeyang <xiekeyang@users.noreply.github.com>
|
||||
xincaosu <xincaosu@126.com>
|
||||
xinluyin <31590468+xinluyin@users.noreply.github.com>
|
||||
Xudong Liu <33193253+r1cs@users.noreply.github.com>
|
||||
xwjack <XWJACK@users.noreply.github.com>
|
||||
yahtoo <yahtoo.ma@gmail.com>
|
||||
Yang Hau <vulxj0j8j8@gmail.com>
|
||||
YaoZengzeng <yaozengzeng@zju.edu.cn>
|
||||
YH-Zhou <yanhong.zhou05@gmail.com>
|
||||
Yihau Chen <a122092487@gmail.com>
|
||||
Yohann Léon <sybiload@gmail.com>
|
||||
Yoichi Hirai <i@yoichihirai.com>
|
||||
Yole <007yuyue@gmail.com>
|
||||
Yondon Fu <yondon.fu@gmail.com>
|
||||
YOSHIDA Masanori <masanori.yoshida@gmail.com>
|
||||
yoza <yoza.is12s@gmail.com>
|
||||
yumiel yoomee1313 <yumiel.ko@groundx.xyz>
|
||||
Yusup <awklsgrep@gmail.com>
|
||||
yutianwu <wzxingbupt@gmail.com>
|
||||
ywzqwwt <39263032+ywzqwwt@users.noreply.github.com>
|
||||
zaccoding <zaccoding725@gmail.com>
|
||||
Zach <zach.ramsay@gmail.com>
|
||||
Zachinquarantine <Zachinquarantine@protonmail.com>
|
||||
zah <zahary@gmail.com>
|
||||
Zahoor Mohamed <zahoor@zahoor.in>
|
||||
Zak Cole <zak@beattiecole.com>
|
||||
zcheng9 <zcheng9@hawk.iit.edu>
|
||||
zer0to0ne <36526113+zer0to0ne@users.noreply.github.com>
|
||||
zgfzgf <48779939+zgfzgf@users.noreply.github.com>
|
||||
Zhang Zhuo <mycinbrin@gmail.com>
|
||||
zhangsoledad <787953403@qq.com>
|
||||
zhaochonghe <41711151+zhaochonghe@users.noreply.github.com>
|
||||
Zhenguo Niu <Niu.ZGlinux@gmail.com>
|
||||
zhiqiangxu <652732310@qq.com>
|
||||
Zhou Zhiyao <ZHOU0250@e.ntu.edu.sg>
|
||||
Ziyuan Zhong <zzy.albert@163.com>
|
||||
Zoe Nolan <github@zoenolan.org>
|
||||
Zou Guangxian <zouguangxian@gmail.com>
|
||||
Zsolt Felföldi <zsfelfoldi@gmail.com>
|
||||
Łukasz Kurowski <crackcomm@users.noreply.github.com>
|
||||
Łukasz Zimnoch <lukaszzimnoch1994@gmail.com>
|
||||
ΞTHΞЯSPHΞЯΞ <{viktor.tron,nagydani,zsfelfoldi}@gmail.com>
|
||||
Максим Чусовлянов <mchusovlianov@gmail.com>
|
||||
大彬 <hz_stb@163.com>
|
||||
沉风 <myself659@users.noreply.github.com>
|
||||
贺鹏飞 <hpf@hackerful.cn>
|
||||
陈佳 <chenjiablog@gmail.com>
|
||||
유용환 <33824408+eric-yoo@users.noreply.github.com>
|
||||
|
||||
@@ -42,7 +42,7 @@ directory.
|
||||
| `abigen` | Source code generator to convert Ethereum contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Ethereum contract ABIs](https://docs.soliditylang.org/en/develop/abi-spec.html) with expanded functionality if the contract bytecode is also available. However, it also accepts Solidity source files, making development much more streamlined. Please see our [Native DApps](https://geth.ethereum.org/docs/dapp/native-bindings) page for details. |
|
||||
| `bootnode` | Stripped down version of our Ethereum client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks. |
|
||||
| `evm` | Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow isolated, fine-grained debugging of EVM opcodes (e.g. `evm --code 60ff60ff --debug run`). |
|
||||
| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user-friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). |
|
||||
| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://eth.wiki/en/fundamentals/rlp)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user-friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). |
|
||||
| `puppeth` | a CLI wizard that aids in creating a new Ethereum network. |
|
||||
|
||||
## Running `geth`
|
||||
@@ -188,7 +188,7 @@ accessible from the outside.
|
||||
|
||||
As a developer, sooner rather than later you'll want to start interacting with `geth` and the
|
||||
Ethereum network via your own programs and not manually through the console. To aid
|
||||
this, `geth` has built-in support for a JSON-RPC based APIs ([standard APIs](https://ethereum.github.io/execution-apis/api-documentation/)
|
||||
this, `geth` has built-in support for a JSON-RPC based APIs ([standard APIs](https://eth.wiki/json-rpc/API)
|
||||
and [`geth` specific APIs](https://geth.ethereum.org/docs/rpc/server)).
|
||||
These can be exposed via HTTP, WebSockets and IPC (UNIX sockets on UNIX based
|
||||
platforms, and named pipes on Windows).
|
||||
@@ -297,7 +297,7 @@ $ bootnode --genkey=boot.key
|
||||
$ bootnode --nodekey=boot.key
|
||||
```
|
||||
|
||||
With the bootnode online, it will display an [`enode` URL](https://ethereum.org/en/developers/docs/networking-layer/network-addresses/#enode)
|
||||
With the bootnode online, it will display an [`enode` URL](https://eth.wiki/en/fundamentals/enode-url-format)
|
||||
that other nodes can use to connect to it and exchange peer information. Make sure to
|
||||
replace the displayed IP address information (most probably `[::]`) with your externally
|
||||
accessible IP to get the actual `enode` URL.
|
||||
|
||||
@@ -164,7 +164,7 @@ func (abi *ABI) UnmarshalJSON(data []byte) error {
|
||||
case "constructor":
|
||||
abi.Constructor = NewMethod("", "", Constructor, field.StateMutability, field.Constant, field.Payable, field.Inputs, nil)
|
||||
case "function":
|
||||
name := ResolveNameConflict(field.Name, func(s string) bool { _, ok := abi.Methods[s]; return ok })
|
||||
name := overloadedName(field.Name, func(s string) bool { _, ok := abi.Methods[s]; return ok })
|
||||
abi.Methods[name] = NewMethod(name, field.Name, Function, field.StateMutability, field.Constant, field.Payable, field.Inputs, field.Outputs)
|
||||
case "fallback":
|
||||
// New introduced function type in v0.6.0, check more detail
|
||||
@@ -184,11 +184,9 @@ func (abi *ABI) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
abi.Receive = NewMethod("", "", Receive, field.StateMutability, field.Constant, field.Payable, nil, nil)
|
||||
case "event":
|
||||
name := ResolveNameConflict(field.Name, func(s string) bool { _, ok := abi.Events[s]; return ok })
|
||||
name := overloadedName(field.Name, func(s string) bool { _, ok := abi.Events[s]; return ok })
|
||||
abi.Events[name] = NewEvent(name, field.Name, field.Anonymous, field.Inputs)
|
||||
case "error":
|
||||
// Errors cannot be overloaded or overridden but are inherited,
|
||||
// no need to resolve the name conflict here.
|
||||
abi.Errors[field.Name] = NewError(field.Name, field.Inputs)
|
||||
default:
|
||||
return fmt.Errorf("abi: could not recognize type %v of field %v", field.Type, field.Name)
|
||||
@@ -253,3 +251,20 @@ func UnpackRevert(data []byte) (string, error) {
|
||||
}
|
||||
return unpacked[0].(string), nil
|
||||
}
|
||||
|
||||
// overloadedName returns the next available name for a given thing.
|
||||
// Needed since solidity allows for overloading.
|
||||
//
|
||||
// e.g. if the abi contains Methods send, send1
|
||||
// overloadedName would return send2 for input send.
|
||||
//
|
||||
// overloadedName works for methods, events and errors.
|
||||
func overloadedName(rawName string, isAvail func(string) bool) string {
|
||||
name := rawName
|
||||
ok := isAvail(name)
|
||||
for idx := 0; ok; idx++ {
|
||||
name = fmt.Sprintf("%s%d", rawName, idx)
|
||||
ok = isAvail(name)
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
||||
@@ -1038,7 +1038,9 @@ func TestABI_EventById(t *testing.T) {
|
||||
}
|
||||
if event == nil {
|
||||
t.Errorf("We should find a event for topic %s, test #%d", topicID.Hex(), testnum)
|
||||
} else if event.ID != topicID {
|
||||
}
|
||||
|
||||
if event.ID != topicID {
|
||||
t.Errorf("Event id %s does not match topic %s, test #%d", event.ID.Hex(), topicID.Hex(), testnum)
|
||||
}
|
||||
|
||||
|
||||
@@ -63,10 +63,9 @@ type SimulatedBackend struct {
|
||||
database ethdb.Database // In memory database to store our testing data
|
||||
blockchain *core.BlockChain // Ethereum blockchain to handle the consensus
|
||||
|
||||
mu sync.Mutex
|
||||
pendingBlock *types.Block // Currently pending block that will be imported on request
|
||||
pendingState *state.StateDB // Currently pending state that will be the active on request
|
||||
pendingReceipts types.Receipts // Currently receipts for the pending block
|
||||
mu sync.Mutex
|
||||
pendingBlock *types.Block // Currently pending block that will be imported on request
|
||||
pendingState *state.StateDB // Currently pending state that will be the active on request
|
||||
|
||||
events *filters.EventSystem // Event system for filtering log events live
|
||||
|
||||
@@ -85,8 +84,8 @@ func NewSimulatedBackendWithDatabase(database ethdb.Database, alloc core.Genesis
|
||||
database: database,
|
||||
blockchain: blockchain,
|
||||
config: genesis.Config,
|
||||
events: filters.NewEventSystem(&filterBackend{database, blockchain}, false),
|
||||
}
|
||||
backend.events = filters.NewEventSystem(&filterBackend{database, blockchain, backend}, false)
|
||||
backend.rollback(blockchain.CurrentBlock())
|
||||
return backend
|
||||
}
|
||||
@@ -663,7 +662,7 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
|
||||
return fmt.Errorf("invalid transaction nonce: got %d, want %d", tx.Nonce(), nonce)
|
||||
}
|
||||
// Include tx in chain
|
||||
blocks, receipts := core.GenerateChain(b.config, block, ethash.NewFaker(), b.database, 1, func(number int, block *core.BlockGen) {
|
||||
blocks, _ := core.GenerateChain(b.config, block, ethash.NewFaker(), b.database, 1, func(number int, block *core.BlockGen) {
|
||||
for _, tx := range b.pendingBlock.Transactions() {
|
||||
block.AddTxWithChain(b.blockchain, tx)
|
||||
}
|
||||
@@ -673,7 +672,6 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
|
||||
|
||||
b.pendingBlock = blocks[0]
|
||||
b.pendingState, _ = state.New(b.pendingBlock.Root(), stateDB.Database(), nil)
|
||||
b.pendingReceipts = receipts[0]
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -685,7 +683,7 @@ func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.Filter
|
||||
var filter *filters.Filter
|
||||
if query.BlockHash != nil {
|
||||
// Block filter requested, construct a single-shot filter
|
||||
filter = filters.NewBlockFilter(&filterBackend{b.database, b.blockchain, b}, *query.BlockHash, query.Addresses, query.Topics)
|
||||
filter = filters.NewBlockFilter(&filterBackend{b.database, b.blockchain}, *query.BlockHash, query.Addresses, query.Topics)
|
||||
} else {
|
||||
// Initialize unset filter boundaries to run from genesis to chain head
|
||||
from := int64(0)
|
||||
@@ -697,7 +695,7 @@ func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.Filter
|
||||
to = query.ToBlock.Int64()
|
||||
}
|
||||
// Construct the range filter
|
||||
filter = filters.NewRangeFilter(&filterBackend{b.database, b.blockchain, b}, from, to, query.Addresses, query.Topics)
|
||||
filter = filters.NewRangeFilter(&filterBackend{b.database, b.blockchain}, from, to, query.Addresses, query.Topics)
|
||||
}
|
||||
// Run the filter and return all the logs
|
||||
logs, err := filter.Logs(ctx)
|
||||
@@ -818,9 +816,8 @@ func (m callMsg) AccessList() types.AccessList { return m.CallMsg.AccessList }
|
||||
// filterBackend implements filters.Backend to support filtering for logs without
|
||||
// taking bloom-bits acceleration structures into account.
|
||||
type filterBackend struct {
|
||||
db ethdb.Database
|
||||
bc *core.BlockChain
|
||||
backend *SimulatedBackend
|
||||
db ethdb.Database
|
||||
bc *core.BlockChain
|
||||
}
|
||||
|
||||
func (fb *filterBackend) ChainDb() ethdb.Database { return fb.db }
|
||||
@@ -837,10 +834,6 @@ func (fb *filterBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*t
|
||||
return fb.bc.GetHeaderByHash(hash), nil
|
||||
}
|
||||
|
||||
func (fb *filterBackend) PendingBlockAndReceipts() (*types.Block, types.Receipts) {
|
||||
return fb.backend.pendingBlock, fb.backend.pendingReceipts
|
||||
}
|
||||
|
||||
func (fb *filterBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) {
|
||||
number := rawdb.ReadHeaderNumber(fb.db, hash)
|
||||
if number == nil {
|
||||
|
||||
@@ -655,7 +655,8 @@ func TestHeaderByNumber(t *testing.T) {
|
||||
}
|
||||
if latestBlockHeader == nil {
|
||||
t.Errorf("received a nil block header")
|
||||
} else if latestBlockHeader.Number.Uint64() != uint64(0) {
|
||||
}
|
||||
if latestBlockHeader.Number.Uint64() != uint64(0) {
|
||||
t.Errorf("expected block header number 0, instead got %v", latestBlockHeader.Number.Uint64())
|
||||
}
|
||||
|
||||
|
||||
@@ -488,11 +488,3 @@ func TestCall(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestCrashers contains some strings which previously caused the abi codec to crash.
|
||||
func TestCrashers(t *testing.T) {
|
||||
abi.JSON(strings.NewReader(`[{"inputs":[{"type":"tuple[]","components":[{"type":"bool","name":"_1"}]}]}]`))
|
||||
abi.JSON(strings.NewReader(`[{"inputs":[{"type":"tuple[]","components":[{"type":"bool","name":"&"}]}]}]`))
|
||||
abi.JSON(strings.NewReader(`[{"inputs":[{"type":"tuple[]","components":[{"type":"bool","name":"----"}]}]}]`))
|
||||
abi.JSON(strings.NewReader(`[{"inputs":[{"type":"tuple[]","components":[{"type":"bool","name":"foo.Bar"}]}]}]`))
|
||||
}
|
||||
|
||||
@@ -99,7 +99,6 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
|
||||
// Normalize the method for capital cases and non-anonymous inputs/outputs
|
||||
normalized := original
|
||||
normalizedName := methodNormalizer[lang](alias(aliases, original.Name))
|
||||
|
||||
// Ensure there is no duplicated identifier
|
||||
var identifiers = callIdentifiers
|
||||
if !original.IsConstant() {
|
||||
@@ -109,7 +108,6 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
|
||||
return "", fmt.Errorf("duplicated identifier \"%s\"(normalized \"%s\"), use --alias for renaming", original.Name, normalizedName)
|
||||
}
|
||||
identifiers[normalizedName] = true
|
||||
|
||||
normalized.Name = normalizedName
|
||||
normalized.Inputs = make([]abi.Argument, len(original.Inputs))
|
||||
copy(normalized.Inputs, original.Inputs)
|
||||
@@ -154,22 +152,12 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
|
||||
eventIdentifiers[normalizedName] = true
|
||||
normalized.Name = normalizedName
|
||||
|
||||
used := make(map[string]bool)
|
||||
normalized.Inputs = make([]abi.Argument, len(original.Inputs))
|
||||
copy(normalized.Inputs, original.Inputs)
|
||||
for j, input := range normalized.Inputs {
|
||||
if input.Name == "" {
|
||||
normalized.Inputs[j].Name = fmt.Sprintf("arg%d", j)
|
||||
}
|
||||
// Event is a bit special, we need to define event struct in binding,
|
||||
// ensure there is no camel-case-style name conflict.
|
||||
for index := 0; ; index++ {
|
||||
if !used[capitalise(normalized.Inputs[j].Name)] {
|
||||
used[capitalise(normalized.Inputs[j].Name)] = true
|
||||
break
|
||||
}
|
||||
normalized.Inputs[j].Name = fmt.Sprintf("%s%d", normalized.Inputs[j].Name, index)
|
||||
}
|
||||
if hasStruct(input.Type) {
|
||||
bindStructType[lang](input.Type, structs)
|
||||
}
|
||||
@@ -444,22 +432,15 @@ func bindStructTypeGo(kind abi.Type, structs map[string]*tmplStruct) string {
|
||||
if s, exist := structs[id]; exist {
|
||||
return s.Name
|
||||
}
|
||||
var (
|
||||
names = make(map[string]bool)
|
||||
fields []*tmplField
|
||||
)
|
||||
var fields []*tmplField
|
||||
for i, elem := range kind.TupleElems {
|
||||
name := capitalise(kind.TupleRawNames[i])
|
||||
name = abi.ResolveNameConflict(name, func(s string) bool { return names[s] })
|
||||
names[name] = true
|
||||
fields = append(fields, &tmplField{Type: bindStructTypeGo(*elem, structs), Name: name, SolKind: *elem})
|
||||
field := bindStructTypeGo(*elem, structs)
|
||||
fields = append(fields, &tmplField{Type: field, Name: capitalise(kind.TupleRawNames[i]), SolKind: *elem})
|
||||
}
|
||||
name := kind.TupleRawName
|
||||
if name == "" {
|
||||
name = fmt.Sprintf("Struct%d", len(structs))
|
||||
}
|
||||
name = capitalise(name)
|
||||
|
||||
structs[id] = &tmplStruct{
|
||||
Name: name,
|
||||
Fields: fields,
|
||||
|
||||
@@ -1948,54 +1948,6 @@ var bindTests = []struct {
|
||||
}
|
||||
sim.Commit()
|
||||
|
||||
if _, err = bind.WaitDeployed(nil, sim, tx); err != nil {
|
||||
t.Logf("Deployment tx: %+v", tx)
|
||||
t.Errorf("bind.WaitDeployed(nil, %T, <deployment tx>) got err %v; want nil err", sim, err)
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: `NameConflict`,
|
||||
contract: `
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.4.22 <0.9.0;
|
||||
contract oracle {
|
||||
struct request {
|
||||
bytes data;
|
||||
bytes _data;
|
||||
}
|
||||
event log (int msg, int _msg);
|
||||
function addRequest(request memory req) public pure {}
|
||||
function getRequest() pure public returns (request memory) {
|
||||
return request("", "");
|
||||
}
|
||||
}
|
||||
`,
|
||||
bytecode: []string{`0x608060405234801561001057600080fd5b5061042b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063c2bb515f1461003b578063cce7b04814610059575b600080fd5b610043610075565b60405161005091906101af565b60405180910390f35b610073600480360381019061006e91906103ac565b6100b5565b005b61007d6100b8565b604051806040016040528060405180602001604052806000815250815260200160405180602001604052806000815250815250905090565b50565b604051806040016040528060608152602001606081525090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561010c5780820151818401526020810190506100f1565b8381111561011b576000848401525b50505050565b6000601f19601f8301169050919050565b600061013d826100d2565b61014781856100dd565b93506101578185602086016100ee565b61016081610121565b840191505092915050565b600060408301600083015184820360008601526101888282610132565b915050602083015184820360208601526101a28282610132565b9150508091505092915050565b600060208201905081810360008301526101c9818461016b565b905092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61022282610121565b810181811067ffffffffffffffff82111715610241576102406101ea565b5b80604052505050565b60006102546101d1565b90506102608282610219565b919050565b600080fd5b600080fd5b600080fd5b600067ffffffffffffffff82111561028f5761028e6101ea565b5b61029882610121565b9050602081019050919050565b82818337600083830152505050565b60006102c76102c284610274565b61024a565b9050828152602081018484840111156102e3576102e261026f565b5b6102ee8482856102a5565b509392505050565b600082601f83011261030b5761030a61026a565b5b813561031b8482602086016102b4565b91505092915050565b60006040828403121561033a576103396101e5565b5b610344604061024a565b9050600082013567ffffffffffffffff81111561036457610363610265565b5b610370848285016102f6565b600083015250602082013567ffffffffffffffff81111561039457610393610265565b5b6103a0848285016102f6565b60208301525092915050565b6000602082840312156103c2576103c16101db565b5b600082013567ffffffffffffffff8111156103e0576103df6101e0565b5b6103ec84828501610324565b9150509291505056fea264697066735822122033bca1606af9b6aeba1673f98c52003cec19338539fb44b86690ce82c51483b564736f6c634300080e0033`},
|
||||
abi: []string{`[ { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "int256", "name": "msg", "type": "int256" }, { "indexed": false, "internalType": "int256", "name": "_msg", "type": "int256" } ], "name": "log", "type": "event" }, { "inputs": [ { "components": [ { "internalType": "bytes", "name": "data", "type": "bytes" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "internalType": "struct oracle.request", "name": "req", "type": "tuple" } ], "name": "addRequest", "outputs": [], "stateMutability": "pure", "type": "function" }, { "inputs": [], "name": "getRequest", "outputs": [ { "components": [ { "internalType": "bytes", "name": "data", "type": "bytes" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "internalType": "struct oracle.request", "name": "", "type": "tuple" } ], "stateMutability": "pure", "type": "function" } ]`},
|
||||
imports: `
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/eth/ethconfig"
|
||||
`,
|
||||
tester: `
|
||||
var (
|
||||
key, _ = crypto.GenerateKey()
|
||||
user, _ = bind.NewKeyedTransactorWithChainID(key, big.NewInt(1337))
|
||||
sim = backends.NewSimulatedBackend(core.GenesisAlloc{user.From: {Balance: big.NewInt(1000000000000000000)}}, ethconfig.Defaults.Miner.GasCeil)
|
||||
)
|
||||
defer sim.Close()
|
||||
|
||||
_, tx, _, err := DeployNameConflict(user, sim)
|
||||
if err != nil {
|
||||
t.Fatalf("DeployNameConflict() got err %v; want nil err", err)
|
||||
}
|
||||
sim.Commit()
|
||||
|
||||
if _, err = bind.WaitDeployed(nil, sim, tx); err != nil {
|
||||
t.Logf("Deployment tx: %+v", tx)
|
||||
t.Errorf("bind.WaitDeployed(nil, %T, <deployment tx>) got err %v; want nil err", sim, err)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2016 The go-ethereum Authors
|
||||
// Copyright 2021 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
@@ -30,13 +30,11 @@ type Error struct {
|
||||
Name string
|
||||
Inputs Arguments
|
||||
str string
|
||||
|
||||
// Sig contains the string signature according to the ABI spec.
|
||||
// e.g. error foo(uint32 a, int b) = "foo(uint32,int256)"
|
||||
// e.g. event foo(uint32 a, int b) = "foo(uint32,int256)"
|
||||
// Please note that "int" is substitute for its canonical representation "int256"
|
||||
Sig string
|
||||
|
||||
// ID returns the canonical representation of the error's signature used by the
|
||||
// ID returns the canonical representation of the event's signature used by the
|
||||
// abi definition to identify event names and types.
|
||||
ID common.Hash
|
||||
}
|
||||
|
||||
@@ -29,27 +29,24 @@ import (
|
||||
// don't get the signature canonical representation as the first LOG topic.
|
||||
type Event struct {
|
||||
// Name is the event name used for internal representation. It's derived from
|
||||
// the raw name and a suffix will be added in the case of event overloading.
|
||||
// the raw name and a suffix will be added in the case of a event overload.
|
||||
//
|
||||
// e.g.
|
||||
// These are two events that have the same name:
|
||||
// * foo(int,int)
|
||||
// * foo(uint,uint)
|
||||
// The event name of the first one will be resolved as foo while the second one
|
||||
// The event name of the first one wll be resolved as foo while the second one
|
||||
// will be resolved as foo0.
|
||||
Name string
|
||||
|
||||
// RawName is the raw event name parsed from ABI.
|
||||
RawName string
|
||||
Anonymous bool
|
||||
Inputs Arguments
|
||||
str string
|
||||
|
||||
// Sig contains the string signature according to the ABI spec.
|
||||
// e.g. event foo(uint32 a, int b) = "foo(uint32,int256)"
|
||||
// Please note that "int" is substitute for its canonical representation "int256"
|
||||
Sig string
|
||||
|
||||
// ID returns the canonical representation of the event's signature used by the
|
||||
// abi definition to identify event names and types.
|
||||
ID common.Hash
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
// Copyright 2022 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package abi
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
// Copyright 2022 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package abi
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// Copyright 2019 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -23,8 +23,6 @@ import (
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
)
|
||||
@@ -163,26 +161,19 @@ func NewType(t string, internalType string, components []ArgumentMarshaling) (ty
|
||||
elems []*Type
|
||||
names []string
|
||||
expression string // canonical parameter expression
|
||||
used = make(map[string]bool)
|
||||
)
|
||||
expression += "("
|
||||
overloadedNames := make(map[string]string)
|
||||
for idx, c := range components {
|
||||
cType, err := NewType(c.Type, c.InternalType, c.Components)
|
||||
if err != nil {
|
||||
return Type{}, err
|
||||
}
|
||||
name := ToCamelCase(c.Name)
|
||||
if name == "" {
|
||||
return Type{}, errors.New("abi: purely anonymous or underscored field is not supported")
|
||||
}
|
||||
fieldName := ResolveNameConflict(name, func(s string) bool { return used[s] })
|
||||
fieldName, err := overloadedArgName(c.Name, overloadedNames)
|
||||
if err != nil {
|
||||
return Type{}, err
|
||||
}
|
||||
used[fieldName] = true
|
||||
if !isValidFieldName(fieldName) {
|
||||
return Type{}, fmt.Errorf("field %d has invalid name", idx)
|
||||
}
|
||||
overloadedNames[fieldName] = fieldName
|
||||
fields = append(fields, reflect.StructField{
|
||||
Name: fieldName, // reflect.StructOf will panic for any exported field.
|
||||
Type: cType.GetType(),
|
||||
@@ -259,6 +250,20 @@ func (t Type) GetType() reflect.Type {
|
||||
}
|
||||
}
|
||||
|
||||
func overloadedArgName(rawName string, names map[string]string) (string, error) {
|
||||
fieldName := ToCamelCase(rawName)
|
||||
if fieldName == "" {
|
||||
return "", errors.New("abi: purely anonymous or underscored field is not supported")
|
||||
}
|
||||
// Handle overloaded fieldNames
|
||||
_, ok := names[fieldName]
|
||||
for idx := 0; ok; idx++ {
|
||||
fieldName = fmt.Sprintf("%s%d", ToCamelCase(rawName), idx)
|
||||
_, ok = names[fieldName]
|
||||
}
|
||||
return fieldName, nil
|
||||
}
|
||||
|
||||
// String implements Stringer.
|
||||
func (t Type) String() (out string) {
|
||||
return t.stringKind
|
||||
@@ -394,30 +399,3 @@ func getTypeSize(t Type) int {
|
||||
}
|
||||
return 32
|
||||
}
|
||||
|
||||
// isLetter reports whether a given 'rune' is classified as a Letter.
|
||||
// This method is copied from reflect/type.go
|
||||
func isLetter(ch rune) bool {
|
||||
return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= utf8.RuneSelf && unicode.IsLetter(ch)
|
||||
}
|
||||
|
||||
// isValidFieldName checks if a string is a valid (struct) field name or not.
|
||||
//
|
||||
// According to the language spec, a field name should be an identifier.
|
||||
//
|
||||
// identifier = letter { letter | unicode_digit } .
|
||||
// letter = unicode_letter | "_" .
|
||||
// This method is copied from reflect/type.go
|
||||
func isValidFieldName(fieldName string) bool {
|
||||
for i, c := range fieldName {
|
||||
if i == 0 && !isLetter(c) {
|
||||
return false
|
||||
}
|
||||
|
||||
if !(isLetter(c) || unicode.IsDigit(c)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return len(fieldName) > 0
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ func toGoType(index int, t Type, output []byte) (interface{}, error) {
|
||||
|
||||
// lengthPrefixPointsTo interprets a 32 byte slice as an offset and then determines which indices to look to decode the type.
|
||||
func lengthPrefixPointsTo(index int, output []byte) (start int, length int, err error) {
|
||||
bigOffsetEnd := new(big.Int).SetBytes(output[index : index+32])
|
||||
bigOffsetEnd := big.NewInt(0).SetBytes(output[index : index+32])
|
||||
bigOffsetEnd.Add(bigOffsetEnd, common.Big32)
|
||||
outputLength := big.NewInt(int64(len(output)))
|
||||
|
||||
@@ -268,9 +268,11 @@ func lengthPrefixPointsTo(index int, output []byte) (start int, length int, err
|
||||
}
|
||||
|
||||
offsetEnd := int(bigOffsetEnd.Uint64())
|
||||
lengthBig := new(big.Int).SetBytes(output[offsetEnd-32 : offsetEnd])
|
||||
lengthBig := big.NewInt(0).SetBytes(output[offsetEnd-32 : offsetEnd])
|
||||
|
||||
totalSize := new(big.Int).Add(bigOffsetEnd, lengthBig)
|
||||
totalSize := big.NewInt(0)
|
||||
totalSize.Add(totalSize, bigOffsetEnd)
|
||||
totalSize.Add(totalSize, lengthBig)
|
||||
if totalSize.BitLen() > 63 {
|
||||
return 0, 0, fmt.Errorf("abi: length larger than int64: %v", totalSize)
|
||||
}
|
||||
@@ -285,7 +287,7 @@ func lengthPrefixPointsTo(index int, output []byte) (start int, length int, err
|
||||
|
||||
// tuplePointsTo resolves the location reference for dynamic tuple.
|
||||
func tuplePointsTo(index int, output []byte) (start int, err error) {
|
||||
offset := new(big.Int).SetBytes(output[index : index+32])
|
||||
offset := big.NewInt(0).SetBytes(output[index : index+32])
|
||||
outputLen := big.NewInt(int64(len(output)))
|
||||
|
||||
if offset.Cmp(outputLen) > 0 {
|
||||
|
||||
@@ -424,7 +424,7 @@ func TestMultiReturnWithStringArray(t *testing.T) {
|
||||
}
|
||||
buff := new(bytes.Buffer)
|
||||
buff.Write(common.Hex2Bytes("000000000000000000000000000000000000000000000000000000005c1b78ea0000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000001a055690d9db80000000000000000000000000000ab1257528b3782fb40d7ed5f72e624b744dffb2f00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000008457468657265756d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001048656c6c6f2c20457468657265756d2100000000000000000000000000000000"))
|
||||
temp, _ := new(big.Int).SetString("30000000000000000000", 10)
|
||||
temp, _ := big.NewInt(0).SetString("30000000000000000000", 10)
|
||||
ret1, ret1Exp := new([3]*big.Int), [3]*big.Int{big.NewInt(1545304298), big.NewInt(6), temp}
|
||||
ret2, ret2Exp := new(common.Address), common.HexToAddress("ab1257528b3782fb40d7ed5f72e624b744dffb2f")
|
||||
ret3, ret3Exp := new([2]string), [2]string{"Ethereum", "Hello, Ethereum!"}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
// Copyright 2022 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package abi
|
||||
|
||||
import "fmt"
|
||||
|
||||
// ResolveNameConflict returns the next available name for a given thing.
|
||||
// This helper can be used for lots of purposes:
|
||||
//
|
||||
// - In solidity function overloading is supported, this function can fix
|
||||
// the name conflicts of overloaded functions.
|
||||
// - In golang binding generation, the parameter(in function, event, error,
|
||||
// and struct definition) name will be converted to camelcase style which
|
||||
// may eventually lead to name conflicts.
|
||||
//
|
||||
// Name conflicts are mostly resolved by adding number suffix.
|
||||
// e.g. if the abi contains Methods send, send1
|
||||
// ResolveNameConflict would return send2 for input send.
|
||||
func ResolveNameConflict(rawName string, used func(string) bool) string {
|
||||
name := rawName
|
||||
ok := used(name)
|
||||
for idx := 0; ok; idx++ {
|
||||
name = fmt.Sprintf("%s%d", rawName, idx)
|
||||
ok = used(name)
|
||||
}
|
||||
return name
|
||||
}
|
||||
4
accounts/external/backend.go
vendored
4
accounts/external/backend.go
vendored
@@ -152,6 +152,10 @@ func (api *ExternalSigner) SelfDerive(bases []accounts.DerivationPath, chain eth
|
||||
log.Error("operation SelfDerive not supported on external signers")
|
||||
}
|
||||
|
||||
func (api *ExternalSigner) signHash(account accounts.Account, hash []byte) ([]byte, error) {
|
||||
return []byte{}, fmt.Errorf("operation not supported on external signers")
|
||||
}
|
||||
|
||||
// SignData signs keccak256(data). The mimetype parameter describes the type of data being signed
|
||||
func (api *ExternalSigner) SignData(account accounts.Account, mimeType string, data []byte) ([]byte, error) {
|
||||
var res hexutil.Bytes
|
||||
|
||||
@@ -383,7 +383,7 @@ func TestUpdatedKeyfileContents(t *testing.T) {
|
||||
time.Sleep(1000 * time.Millisecond)
|
||||
|
||||
// Now replace file contents with crap
|
||||
if err := os.WriteFile(file, []byte("foo"), 0600); err != nil {
|
||||
if err := os.WriteFile(file, []byte("foo"), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ func TestKeyEncryptDecrypt(t *testing.T) {
|
||||
t.Errorf("test %d: key address mismatch: have %x, want %x", i, key.Address, address)
|
||||
}
|
||||
// Recrypt with a new password and start over
|
||||
password += "new data appended" // nolint: gosec
|
||||
password += "new data appended"
|
||||
if keyjson, err = EncryptKey(key, password, veryLightScryptN, veryLightScryptP); err != nil {
|
||||
t.Errorf("test %d: failed to recrypt key %v", i, err)
|
||||
}
|
||||
|
||||
@@ -32,10 +32,9 @@ func TestURLParsing(t *testing.T) {
|
||||
t.Errorf("expected: %v, got: %v", "ethereum.org", url.Path)
|
||||
}
|
||||
|
||||
for _, u := range []string{"ethereum.org", ""} {
|
||||
if _, err = parseURL(u); err == nil {
|
||||
t.Errorf("input %v, expected err, got: nil", u)
|
||||
}
|
||||
_, err = parseURL("ethereum.org")
|
||||
if err == nil {
|
||||
t.Error("expected err, got: nil")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
14
build/ci.go
14
build/ci.go
@@ -132,12 +132,12 @@ var (
|
||||
// Note: the following Ubuntu releases have been officially deprecated on Launchpad:
|
||||
// wily, yakkety, zesty, artful, cosmic, disco, eoan, groovy, hirsuite
|
||||
debDistroGoBoots = map[string]string{
|
||||
"trusty": "golang-1.11", // EOL: 04/2024
|
||||
"xenial": "golang-go", // EOL: 04/2026
|
||||
"bionic": "golang-go", // EOL: 04/2028
|
||||
"focal": "golang-go", // EOL: 04/2030
|
||||
"impish": "golang-go", // EOL: 07/2022
|
||||
"jammy": "golang-go", // EOL: 04/2032
|
||||
"trusty": "golang-1.11", // EOL: 04/2024
|
||||
"xenial": "golang-go", // EOL: 04/2026
|
||||
"bionic": "golang-go", // EOL: 04/2028
|
||||
"focal": "golang-go", // EOL: 04/2030
|
||||
"impish": "golang-go", // EOL: 07/2022
|
||||
"jammy": "golang-go", // EOL: 04/2032
|
||||
//"kinetic": "golang-go", // EOL: 07/2023
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ func maybeSkipArchive(env build.Environment) {
|
||||
log.Printf("skipping archive creation because this is a cron job")
|
||||
os.Exit(0)
|
||||
}
|
||||
if env.Branch != "master" && !strings.HasPrefix(env.Tag, "v1.") {
|
||||
if env.Branch != "master" && env.Branch != "buildbot-testing" && !strings.HasPrefix(env.Tag, "v1.") {
|
||||
log.Printf("skipping archive creation because branch %q, tag %q is not on the inclusion list", env.Branch, env.Tag)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build none
|
||||
// +build none
|
||||
|
||||
/*
|
||||
@@ -68,9 +67,7 @@ var (
|
||||
"common/bitutil/bitutil",
|
||||
"common/prque/",
|
||||
"consensus/ethash/xor.go",
|
||||
"crypto/blake2b/",
|
||||
"crypto/bn256/",
|
||||
"crypto/bls12381/",
|
||||
"crypto/ecies/",
|
||||
"graphql/graphiql.go",
|
||||
"internal/jsre/deps",
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// Copyright 2019 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
|
||||
|
||||
@@ -21,9 +21,11 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts/abi"
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||
"github.com/ethereum/go-ethereum/common/compiler"
|
||||
@@ -55,7 +57,25 @@ var (
|
||||
}
|
||||
jsonFlag = cli.StringFlag{
|
||||
Name: "combined-json",
|
||||
Usage: "Path to the combined-json file generated by compiler, - for STDIN",
|
||||
Usage: "Path to the combined-json file generated by compiler",
|
||||
}
|
||||
solFlag = cli.StringFlag{
|
||||
Name: "sol",
|
||||
Usage: "Path to the Ethereum contract Solidity source to build and bind",
|
||||
}
|
||||
solcFlag = cli.StringFlag{
|
||||
Name: "solc",
|
||||
Usage: "Solidity compiler to use if source builds are requested",
|
||||
Value: "solc",
|
||||
}
|
||||
vyFlag = cli.StringFlag{
|
||||
Name: "vy",
|
||||
Usage: "Path to the Ethereum contract Vyper source to build and bind",
|
||||
}
|
||||
vyperFlag = cli.StringFlag{
|
||||
Name: "vyper",
|
||||
Usage: "Vyper compiler to use if source builds are requested",
|
||||
Value: "vyper",
|
||||
}
|
||||
excFlag = cli.StringFlag{
|
||||
Name: "exc",
|
||||
@@ -87,6 +107,10 @@ func init() {
|
||||
binFlag,
|
||||
typeFlag,
|
||||
jsonFlag,
|
||||
solFlag,
|
||||
solcFlag,
|
||||
vyFlag,
|
||||
vyperFlag,
|
||||
excFlag,
|
||||
pkgFlag,
|
||||
outFlag,
|
||||
@@ -98,7 +122,7 @@ func init() {
|
||||
}
|
||||
|
||||
func abigen(c *cli.Context) error {
|
||||
utils.CheckExclusive(c, abiFlag, jsonFlag) // Only one source can be selected.
|
||||
utils.CheckExclusive(c, abiFlag, jsonFlag, solFlag, vyFlag) // Only one source can be selected.
|
||||
if c.GlobalString(pkgFlag.Name) == "" {
|
||||
utils.Fatalf("No destination package specified (--pkg)")
|
||||
}
|
||||
@@ -162,21 +186,36 @@ func abigen(c *cli.Context) error {
|
||||
for _, kind := range strings.Split(c.GlobalString(excFlag.Name), ",") {
|
||||
exclude[strings.ToLower(kind)] = true
|
||||
}
|
||||
var err error
|
||||
var contracts map[string]*compiler.Contract
|
||||
|
||||
if c.GlobalIsSet(jsonFlag.Name) {
|
||||
var (
|
||||
input = c.GlobalString(jsonFlag.Name)
|
||||
jsonOutput []byte
|
||||
err error
|
||||
)
|
||||
if input == "-" {
|
||||
jsonOutput, err = io.ReadAll(os.Stdin)
|
||||
} else {
|
||||
jsonOutput, err = os.ReadFile(input)
|
||||
}
|
||||
switch {
|
||||
case c.GlobalIsSet(solFlag.Name):
|
||||
contracts, err = compiler.CompileSolidity(c.GlobalString(solcFlag.Name), c.GlobalString(solFlag.Name))
|
||||
if err != nil {
|
||||
utils.Fatalf("Failed to read combined-json: %v", err)
|
||||
utils.Fatalf("Failed to build Solidity contract: %v", err)
|
||||
}
|
||||
case c.GlobalIsSet(vyFlag.Name):
|
||||
output, err := compiler.CompileVyper(c.GlobalString(vyperFlag.Name), c.GlobalString(vyFlag.Name))
|
||||
if err != nil {
|
||||
utils.Fatalf("Failed to build Vyper contract: %v", err)
|
||||
}
|
||||
contracts = make(map[string]*compiler.Contract)
|
||||
for n, contract := range output {
|
||||
name := n
|
||||
// Sanitize the combined json names to match the
|
||||
// format expected by solidity.
|
||||
if !strings.Contains(n, ":") {
|
||||
// Remove extra path components
|
||||
name = abi.ToCamelCase(strings.TrimSuffix(filepath.Base(name), ".vy"))
|
||||
}
|
||||
contracts[name] = contract
|
||||
}
|
||||
|
||||
case c.GlobalIsSet(jsonFlag.Name):
|
||||
jsonOutput, err := os.ReadFile(c.GlobalString(jsonFlag.Name))
|
||||
if err != nil {
|
||||
utils.Fatalf("Failed to read combined-json from compiler: %v", err)
|
||||
}
|
||||
contracts, err = compiler.ParseCombinedJSON(jsonOutput, "", "", "", "")
|
||||
if err != nil {
|
||||
@@ -198,11 +237,7 @@ func abigen(c *cli.Context) error {
|
||||
nameParts := strings.Split(name, ":")
|
||||
types = append(types, nameParts[len(nameParts)-1])
|
||||
|
||||
// Derive the library placeholder which is a 34 character prefix of the
|
||||
// hex encoding of the keccak256 hash of the fully qualified library name.
|
||||
// Note that the fully qualified library name is the path of its source
|
||||
// file and the library name separated by ":".
|
||||
libPattern := crypto.Keccak256Hash([]byte(name)).String()[2:36] // the first 2 chars are 0x
|
||||
libPattern := crypto.Keccak256Hash([]byte(name)).String()[2:36]
|
||||
libs[libPattern] = nameParts[len(nameParts)-1]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// Copyright 2019 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 The go-ethereum Authors
|
||||
// Copyright 2018 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package ethtest
|
||||
|
||||
@@ -47,7 +47,7 @@ func (c *Chain) Len() int {
|
||||
// TD calculates the total difficulty of the chain at the
|
||||
// chain head.
|
||||
func (c *Chain) TD() *big.Int {
|
||||
sum := new(big.Int)
|
||||
sum := big.NewInt(0)
|
||||
for _, block := range c.blocks[:c.Len()] {
|
||||
sum.Add(sum, block.Difficulty())
|
||||
}
|
||||
@@ -57,7 +57,7 @@ func (c *Chain) TD() *big.Int {
|
||||
// TotalDifficultyAt calculates the total difficulty of the chain
|
||||
// at the given block height.
|
||||
func (c *Chain) TotalDifficultyAt(height int) *big.Int {
|
||||
sum := new(big.Int)
|
||||
sum := big.NewInt(0)
|
||||
if height >= c.Len() {
|
||||
return sum
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package ethtest
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2021 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package ethtest
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package ethtest
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2022 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// Copyright 2014 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package ethtest
|
||||
|
||||
@@ -104,7 +104,6 @@ func (s *Suite) TestSnapGetAccountRange(t *utesting.T) {
|
||||
// Max bytes: 0. Expect to deliver one account.
|
||||
{0, root, zero, ffHash, 1, firstKey, firstKey},
|
||||
} {
|
||||
tc := tc
|
||||
if err := s.snapGetAccountRange(t, &tc); err != nil {
|
||||
t.Errorf("test %d \n root: %x\n range: %#x - %#x\n bytes: %d\nfailed: %v", i, tc.root, tc.origin, tc.limit, tc.nBytes, err)
|
||||
}
|
||||
@@ -195,7 +194,6 @@ func (s *Suite) TestSnapGetStorageRanges(t *utesting.T) {
|
||||
expSlots: 2,
|
||||
},
|
||||
} {
|
||||
tc := tc
|
||||
if err := s.snapGetStorageRanges(t, &tc); err != nil {
|
||||
t.Errorf("test %d \n root: %x\n range: %#x - %#x\n bytes: %d\n #accounts: %d\nfailed: %v",
|
||||
i, tc.root, tc.origin, tc.limit, tc.nBytes, len(tc.accounts), err)
|
||||
@@ -293,7 +291,6 @@ func (s *Suite) TestSnapGetByteCodes(t *utesting.T) {
|
||||
expHashes: 4,
|
||||
},
|
||||
} {
|
||||
tc := tc
|
||||
if err := s.snapGetByteCodes(t, &tc); err != nil {
|
||||
t.Errorf("test %d \n bytes: %d\n #hashes: %d\nfailed: %v", i, tc.nBytes, len(tc.hashes), err)
|
||||
}
|
||||
@@ -439,7 +436,6 @@ func (s *Suite) TestSnapTrieNodes(t *utesting.T) {
|
||||
},
|
||||
},
|
||||
} {
|
||||
tc := tc
|
||||
if err := s.snapGetTrieNodes(t, &tc); err != nil {
|
||||
t.Errorf("test %d \n #hashes %x\n root: %#x\n bytes: %d\nfailed: %v", i, len(tc.expHashes), tc.root, tc.nBytes, err)
|
||||
}
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
// Copyright 2022 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package ethtest
|
||||
|
||||
import "github.com/ethereum/go-ethereum/eth/protocols/snap"
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package ethtest
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2021 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package ethtest
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package ethtest
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package ethtest
|
||||
|
||||
|
||||
@@ -60,9 +60,11 @@ type conn struct {
|
||||
remoteAddr *net.UDPAddr
|
||||
listeners []net.PacketConn
|
||||
|
||||
log logger
|
||||
codec *v5wire.Codec
|
||||
idCounter uint32
|
||||
log logger
|
||||
codec *v5wire.Codec
|
||||
lastRequest v5wire.Packet
|
||||
lastChallenge *v5wire.Whoareyou
|
||||
idCounter uint32
|
||||
}
|
||||
|
||||
type logger interface {
|
||||
|
||||
@@ -21,7 +21,6 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/accounts/keystore"
|
||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
@@ -69,7 +68,7 @@ To sign a message contained in a file, use the --msgfile flag.
|
||||
utils.Fatalf("Error decrypting key: %v", err)
|
||||
}
|
||||
|
||||
signature, err := crypto.Sign(accounts.TextHash(message), key.PrivateKey)
|
||||
signature, err := crypto.Sign(signHash(message), key.PrivateKey)
|
||||
if err != nil {
|
||||
utils.Fatalf("Failed to sign message: %v", err)
|
||||
}
|
||||
@@ -114,7 +113,7 @@ It is possible to refer to a file containing the message.`,
|
||||
utils.Fatalf("Signature encoding is not hexadecimal: %v", err)
|
||||
}
|
||||
|
||||
recoveredPubkey, err := crypto.SigToPub(accounts.TextHash(message), signature)
|
||||
recoveredPubkey, err := crypto.SigToPub(signHash(message), signature)
|
||||
if err != nil || recoveredPubkey == nil {
|
||||
utils.Fatalf("Signature verification failed: %v", err)
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"gopkg.in/urfave/cli.v1"
|
||||
)
|
||||
|
||||
@@ -45,6 +46,18 @@ func getPassphrase(ctx *cli.Context, confirmation bool) string {
|
||||
return utils.GetPassPhrase("", confirmation)
|
||||
}
|
||||
|
||||
// signHash is a helper function that calculates a hash for the given message
|
||||
// that can be safely used to calculate a signature from.
|
||||
//
|
||||
// The hash is calculated as
|
||||
// keccak256("\x19Ethereum Signed Message:\n"${message length}${message}).
|
||||
//
|
||||
// This gives context to the signed message and prevents signing of transactions.
|
||||
func signHash(data []byte) []byte {
|
||||
msg := fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(data), data)
|
||||
return crypto.Keccak256([]byte(msg))
|
||||
}
|
||||
|
||||
// mustPrintJSON prints the JSON encoding of the given object and
|
||||
// exits the program with an error message when the marshaling fails.
|
||||
func mustPrintJSON(jsonObject interface{}) {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package t8ntool
|
||||
|
||||
@@ -241,7 +241,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
|
||||
minerReward.Add(minerReward, perOmmer)
|
||||
// Add (8-delta)/8
|
||||
reward := big.NewInt(8)
|
||||
reward.Sub(reward, new(big.Int).SetUint64(ommer.Delta))
|
||||
reward.Sub(reward, big.NewInt(0).SetUint64(ommer.Delta))
|
||||
reward.Mul(reward, blockReward)
|
||||
reward.Div(reward, big.NewInt(8))
|
||||
statedb.AddBalance(ommer.Address, reward)
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package t8ntool
|
||||
|
||||
@@ -152,7 +152,7 @@ var (
|
||||
"\n\tSyntax <forkname>(+ExtraEip)",
|
||||
strings.Join(tests.AvailableForks(), "\n\t "),
|
||||
strings.Join(vm.ActivateableEips(), ", ")),
|
||||
Value: "GrayGlacier",
|
||||
Value: "ArrowGlacier",
|
||||
}
|
||||
VerbosityFlag = cli.IntFlag{
|
||||
Name: "verbosity",
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
// Copyright 2021 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -211,14 +195,6 @@ func TestT8n(t *testing.T) {
|
||||
output: t8nOutput{result: true},
|
||||
expOut: "exp_arrowglacier.json",
|
||||
},
|
||||
{ // Difficulty calculation on gray glacier
|
||||
base: "./testdata/19",
|
||||
input: t8nInput{
|
||||
"alloc.json", "txs.json", "env.json", "GrayGlacier", "",
|
||||
},
|
||||
output: t8nOutput{result: true},
|
||||
expOut: "exp_grayglacier.json",
|
||||
},
|
||||
{ // Sign unprotected (pre-EIP155) transaction
|
||||
base: "./testdata/23",
|
||||
input: t8nInput{
|
||||
|
||||
12
cmd/evm/testdata/19/exp_grayglacier.json
vendored
12
cmd/evm/testdata/19/exp_grayglacier.json
vendored
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"result": {
|
||||
"stateRoot": "0x6f058887ca01549716789c380ede95aecc510e6d1fdc4dbf67d053c7c07f4bdc",
|
||||
"txRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
|
||||
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
|
||||
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
|
||||
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"receipts": [],
|
||||
"currentDifficulty": "0x2000000004000",
|
||||
"gasUsed": "0x0"
|
||||
}
|
||||
}
|
||||
6
cmd/evm/testdata/19/readme.md
vendored
6
cmd/evm/testdata/19/readme.md
vendored
@@ -1,9 +1,9 @@
|
||||
## Difficulty calculation
|
||||
|
||||
This test shows how the `evm t8n` can be used to calculate the (ethash) difficulty, if none is provided by the caller,
|
||||
this time on `GrayGlacier` (Eip 5133).
|
||||
this time on `ArrowGlacier` (Eip 4345).
|
||||
|
||||
Calculating it (with an empty set of txs) using `GrayGlacier` rules (and no provided unclehash for the parent block):
|
||||
Calculating it (with an empty set of txs) using `ArrowGlacier` rules (and no provided unclehash for the parent block):
|
||||
```
|
||||
[user@work evm]$ ./evm t8n --input.alloc=./testdata/19/alloc.json --input.txs=./testdata/19/txs.json --input.env=./testdata/19/env.json --output.result=stdout --state.fork=GrayGlacier
|
||||
[user@work evm]$ ./evm t8n --input.alloc=./testdata/14/alloc.json --input.txs=./testdata/14/txs.json --input.env=./testdata/14/env.json --output.result=stdout --state.fork=ArrowGlacier
|
||||
```
|
||||
@@ -239,15 +239,14 @@ func ambiguousAddrRecovery(ks *keystore.KeyStore, err *keystore.AmbiguousAddrErr
|
||||
}
|
||||
fmt.Println("Testing your password against all of them...")
|
||||
var match *accounts.Account
|
||||
for i, a := range err.Matches {
|
||||
if e := ks.Unlock(a, auth); e == nil {
|
||||
match = &err.Matches[i]
|
||||
for _, a := range err.Matches {
|
||||
if err := ks.Unlock(a, auth); err == nil {
|
||||
match = &a
|
||||
break
|
||||
}
|
||||
}
|
||||
if match == nil {
|
||||
utils.Fatalf("None of the listed files could be unlocked.")
|
||||
return accounts.Account{}
|
||||
}
|
||||
fmt.Printf("Your password unlocked %s\n", match.URL)
|
||||
fmt.Println("In order to avoid this warning, you need to remove the following duplicate key files:")
|
||||
|
||||
@@ -156,15 +156,15 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) {
|
||||
// makeFullNode loads geth configuration and creates the Ethereum backend.
|
||||
func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
|
||||
stack, cfg := makeConfigNode(ctx)
|
||||
if ctx.GlobalIsSet(utils.OverrideGrayGlacierFlag.Name) {
|
||||
cfg.Eth.OverrideGrayGlacier = new(big.Int).SetUint64(ctx.GlobalUint64(utils.OverrideGrayGlacierFlag.Name))
|
||||
if ctx.GlobalIsSet(utils.OverrideArrowGlacierFlag.Name) {
|
||||
cfg.Eth.OverrideArrowGlacier = new(big.Int).SetUint64(ctx.GlobalUint64(utils.OverrideArrowGlacierFlag.Name))
|
||||
}
|
||||
if ctx.GlobalIsSet(utils.OverrideTerminalTotalDifficulty.Name) {
|
||||
cfg.Eth.OverrideTerminalTotalDifficulty = utils.GlobalBig(ctx, utils.OverrideTerminalTotalDifficulty.Name)
|
||||
}
|
||||
backend, eth := utils.RegisterEthService(stack, &cfg.Eth)
|
||||
// Warn users to migrate if they have a legacy freezer format.
|
||||
if eth != nil && !ctx.GlobalIsSet(utils.IgnoreLegacyReceiptsFlag.Name) {
|
||||
if eth != nil {
|
||||
firstIdx := uint64(0)
|
||||
// Hack to speed up check for mainnet because we know
|
||||
// the first non-empty block.
|
||||
@@ -176,8 +176,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
|
||||
if err != nil {
|
||||
log.Error("Failed to check db for legacy receipts", "err", err)
|
||||
} else if isLegacy {
|
||||
stack.Close()
|
||||
utils.Fatalf("Database has receipts with a legacy format. Please run `geth db freezer-migrate`.")
|
||||
log.Warn("Database has receipts with a legacy format. Please run `geth db freezer-migrate`.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2021 The go-ethereum Authors
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
@@ -307,7 +307,7 @@ func checkStateContent(ctx *cli.Context) error {
|
||||
start []byte
|
||||
)
|
||||
if ctx.NArg() > 1 {
|
||||
return fmt.Errorf("max 1 argument: %v", ctx.Command.ArgsUsage)
|
||||
return fmt.Errorf("Max 1 argument: %v", ctx.Command.ArgsUsage)
|
||||
}
|
||||
if ctx.NArg() > 0 {
|
||||
if d, err := hexutil.Decode(ctx.Args().First()); err != nil {
|
||||
@@ -332,8 +332,8 @@ func checkStateContent(ctx *cli.Context) error {
|
||||
)
|
||||
for it.Next() {
|
||||
count++
|
||||
k := it.Key()
|
||||
v := it.Value()
|
||||
k := it.Key()
|
||||
hasher.Reset()
|
||||
hasher.Write(v)
|
||||
hasher.Read(got)
|
||||
@@ -519,7 +519,7 @@ func dbDumpTrie(ctx *cli.Context) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
theTrie, err := trie.New(common.Hash{}, stRoot, trie.NewDatabase(db))
|
||||
theTrie, err := trie.New(stRoot, trie.NewDatabase(db))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -81,6 +65,41 @@ func (g *gethrpc) getNodeInfo() *p2p.NodeInfo {
|
||||
return g.nodeInfo
|
||||
}
|
||||
|
||||
func (g *gethrpc) waitSynced() {
|
||||
// Check if it's synced now
|
||||
var result interface{}
|
||||
g.callRPC(&result, "eth_syncing")
|
||||
syncing, ok := result.(bool)
|
||||
if ok && !syncing {
|
||||
g.geth.Logf("%v already synced", g.name)
|
||||
return
|
||||
}
|
||||
|
||||
// Actually wait, subscribe to the event
|
||||
ch := make(chan interface{})
|
||||
sub, err := g.rpc.Subscribe(context.Background(), "eth", ch, "syncing")
|
||||
if err != nil {
|
||||
g.geth.Fatalf("%v syncing: %v", g.name, err)
|
||||
}
|
||||
defer sub.Unsubscribe()
|
||||
timeout := time.After(4 * time.Second)
|
||||
select {
|
||||
case ev := <-ch:
|
||||
g.geth.Log("'syncing' event", ev)
|
||||
syncing, ok := ev.(bool)
|
||||
if ok && !syncing {
|
||||
break
|
||||
}
|
||||
g.geth.Log("Other 'syncing' event", ev)
|
||||
case err := <-sub.Err():
|
||||
g.geth.Fatalf("%v notification: %v", g.name, err)
|
||||
break
|
||||
case <-timeout:
|
||||
g.geth.Fatalf("%v timeout syncing", g.name)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// ipcEndpoint resolves an IPC endpoint based on a configured value, taking into
|
||||
// account the set data folders as well as the designated platform we're currently
|
||||
// running on.
|
||||
|
||||
@@ -69,7 +69,7 @@ var (
|
||||
utils.NoUSBFlag,
|
||||
utils.USBFlag,
|
||||
utils.SmartCardDaemonPathFlag,
|
||||
utils.OverrideGrayGlacierFlag,
|
||||
utils.OverrideArrowGlacierFlag,
|
||||
utils.OverrideTerminalTotalDifficulty,
|
||||
utils.EthashCacheDirFlag,
|
||||
utils.EthashCachesInMemoryFlag,
|
||||
@@ -151,7 +151,6 @@ var (
|
||||
utils.GpoMaxGasPriceFlag,
|
||||
utils.GpoIgnoreGasPriceFlag,
|
||||
utils.MinerNotifyFullFlag,
|
||||
utils.IgnoreLegacyReceiptsFlag,
|
||||
configFileFlag,
|
||||
}, utils.NetworkFlags, utils.DatabasePathFlags)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2021 The go-ethereum Authors
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -31,6 +32,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/core/state/snapshot"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/ethdb"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
"github.com/ethereum/go-ethereum/trie"
|
||||
@@ -101,23 +103,11 @@ In other words, this command does the snapshot to trie conversion.
|
||||
Description: `
|
||||
geth snapshot check-dangling-storage <state-root> traverses the snap storage
|
||||
data, and verifies that all snapshot storage data has a corresponding account.
|
||||
`,
|
||||
},
|
||||
{
|
||||
Name: "inspect-account",
|
||||
Usage: "Check all snapshot layers for the a specific account",
|
||||
ArgsUsage: "<address | hash>",
|
||||
Action: utils.MigrateFlags(checkAccount),
|
||||
Category: "MISCELLANEOUS COMMANDS",
|
||||
Flags: utils.GroupFlags(utils.NetworkFlags, utils.DatabasePathFlags),
|
||||
Description: `
|
||||
geth snapshot inspect-account <address | hash> checks all snapshot layers and prints out
|
||||
information about the specified address.
|
||||
`,
|
||||
},
|
||||
{
|
||||
Name: "traverse-state",
|
||||
Usage: "Traverse the state with given root hash and perform quick verification",
|
||||
Usage: "Traverse the state with given root hash for verification",
|
||||
ArgsUsage: "<root>",
|
||||
Action: utils.MigrateFlags(traverseState),
|
||||
Category: "MISCELLANEOUS COMMANDS",
|
||||
@@ -133,7 +123,7 @@ It's also usable without snapshot enabled.
|
||||
},
|
||||
{
|
||||
Name: "traverse-rawstate",
|
||||
Usage: "Traverse the state with given root hash and perform detailed verification",
|
||||
Usage: "Traverse the state with given root hash for verification",
|
||||
ArgsUsage: "<root>",
|
||||
Action: utils.MigrateFlags(traverseRawState),
|
||||
Category: "MISCELLANEOUS COMMANDS",
|
||||
@@ -233,7 +223,15 @@ func verifyState(ctx *cli.Context) error {
|
||||
return err
|
||||
}
|
||||
log.Info("Verified the state", "root", root)
|
||||
return snapshot.CheckDanglingStorage(chaindb)
|
||||
if err := checkDanglingDiskStorage(chaindb); err != nil {
|
||||
log.Error("Dangling snap disk-storage check failed", "root", root, "err", err)
|
||||
return err
|
||||
}
|
||||
if err := checkDanglingMemStorage(chaindb); err != nil {
|
||||
log.Error("Dangling snap mem-storage check failed", "root", root, "err", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// checkDanglingStorage iterates the snap storage data, and verifies that all
|
||||
@@ -242,7 +240,56 @@ func checkDanglingStorage(ctx *cli.Context) error {
|
||||
stack, _ := makeConfigNode(ctx)
|
||||
defer stack.Close()
|
||||
|
||||
return snapshot.CheckDanglingStorage(utils.MakeChainDatabase(ctx, stack, true))
|
||||
chaindb := utils.MakeChainDatabase(ctx, stack, true)
|
||||
if err := checkDanglingDiskStorage(chaindb); err != nil {
|
||||
return err
|
||||
}
|
||||
return checkDanglingMemStorage(chaindb)
|
||||
|
||||
}
|
||||
|
||||
// checkDanglingDiskStorage checks if there is any 'dangling' storage data in the
|
||||
// disk-backed snapshot layer.
|
||||
func checkDanglingDiskStorage(chaindb ethdb.Database) error {
|
||||
log.Info("Checking dangling snapshot disk storage")
|
||||
var (
|
||||
lastReport = time.Now()
|
||||
start = time.Now()
|
||||
lastKey []byte
|
||||
it = rawdb.NewKeyLengthIterator(chaindb.NewIterator(rawdb.SnapshotStoragePrefix, nil), 1+2*common.HashLength)
|
||||
)
|
||||
defer it.Release()
|
||||
for it.Next() {
|
||||
k := it.Key()
|
||||
accKey := k[1:33]
|
||||
if bytes.Equal(accKey, lastKey) {
|
||||
// No need to look up for every slot
|
||||
continue
|
||||
}
|
||||
lastKey = common.CopyBytes(accKey)
|
||||
if time.Since(lastReport) > time.Second*8 {
|
||||
log.Info("Iterating snap storage", "at", fmt.Sprintf("%#x", accKey), "elapsed", common.PrettyDuration(time.Since(start)))
|
||||
lastReport = time.Now()
|
||||
}
|
||||
if data := rawdb.ReadAccountSnapshot(chaindb, common.BytesToHash(accKey)); len(data) == 0 {
|
||||
log.Error("Dangling storage - missing account", "account", fmt.Sprintf("%#x", accKey), "storagekey", fmt.Sprintf("%#x", k))
|
||||
return fmt.Errorf("dangling snapshot storage account %#x", accKey)
|
||||
}
|
||||
}
|
||||
log.Info("Verified the snapshot disk storage", "time", common.PrettyDuration(time.Since(start)), "err", it.Error())
|
||||
return nil
|
||||
}
|
||||
|
||||
// checkDanglingMemStorage checks if there is any 'dangling' storage in the journalled
|
||||
// snapshot difflayers.
|
||||
func checkDanglingMemStorage(chaindb ethdb.Database) error {
|
||||
start := time.Now()
|
||||
log.Info("Checking dangling snapshot difflayer journalled storage")
|
||||
if err := snapshot.CheckJournalStorage(chaindb); err != nil {
|
||||
return err
|
||||
}
|
||||
log.Info("Verified the snapshot journalled storage", "time", common.PrettyDuration(time.Since(start)))
|
||||
return nil
|
||||
}
|
||||
|
||||
// traverseState is a helper function used for pruning verification.
|
||||
@@ -278,7 +325,7 @@ func traverseState(ctx *cli.Context) error {
|
||||
log.Info("Start traversing the state", "root", root, "number", headBlock.NumberU64())
|
||||
}
|
||||
triedb := trie.NewDatabase(chaindb)
|
||||
t, err := trie.NewSecure(common.Hash{}, root, triedb)
|
||||
t, err := trie.NewSecure(root, triedb)
|
||||
if err != nil {
|
||||
log.Error("Failed to open trie", "root", root, "err", err)
|
||||
return err
|
||||
@@ -299,7 +346,7 @@ func traverseState(ctx *cli.Context) error {
|
||||
return err
|
||||
}
|
||||
if acc.Root != emptyRoot {
|
||||
storageTrie, err := trie.NewSecure(common.BytesToHash(accIter.Key), acc.Root, triedb)
|
||||
storageTrie, err := trie.NewSecure(acc.Root, triedb)
|
||||
if err != nil {
|
||||
log.Error("Failed to open storage trie", "root", acc.Root, "err", err)
|
||||
return err
|
||||
@@ -367,7 +414,7 @@ func traverseRawState(ctx *cli.Context) error {
|
||||
log.Info("Start traversing the state", "root", root, "number", headBlock.NumberU64())
|
||||
}
|
||||
triedb := trie.NewDatabase(chaindb)
|
||||
t, err := trie.NewSecure(common.Hash{}, root, triedb)
|
||||
t, err := trie.NewSecure(root, triedb)
|
||||
if err != nil {
|
||||
log.Error("Failed to open trie", "root", root, "err", err)
|
||||
return err
|
||||
@@ -379,8 +426,6 @@ func traverseRawState(ctx *cli.Context) error {
|
||||
codes int
|
||||
lastReport time.Time
|
||||
start = time.Now()
|
||||
hasher = crypto.NewKeccakState()
|
||||
got = make([]byte, 32)
|
||||
)
|
||||
accIter := t.NodeIterator(nil)
|
||||
for accIter.Next(true) {
|
||||
@@ -390,18 +435,10 @@ func traverseRawState(ctx *cli.Context) error {
|
||||
// Check the present for non-empty hash node(embedded node doesn't
|
||||
// have their own hash).
|
||||
if node != (common.Hash{}) {
|
||||
blob := rawdb.ReadTrieNode(chaindb, node)
|
||||
if len(blob) == 0 {
|
||||
if !rawdb.HasTrieNode(chaindb, node) {
|
||||
log.Error("Missing trie node(account)", "hash", node)
|
||||
return errors.New("missing account")
|
||||
}
|
||||
hasher.Reset()
|
||||
hasher.Write(blob)
|
||||
hasher.Read(got)
|
||||
if !bytes.Equal(got, node.Bytes()) {
|
||||
log.Error("Invalid trie node(account)", "hash", node.Hex(), "value", blob)
|
||||
return errors.New("invalid account node")
|
||||
}
|
||||
}
|
||||
// If it's a leaf node, yes we are touching an account,
|
||||
// dig into the storage trie further.
|
||||
@@ -413,7 +450,7 @@ func traverseRawState(ctx *cli.Context) error {
|
||||
return errors.New("invalid account")
|
||||
}
|
||||
if acc.Root != emptyRoot {
|
||||
storageTrie, err := trie.NewSecure(common.BytesToHash(accIter.LeafKey()), acc.Root, triedb)
|
||||
storageTrie, err := trie.NewSecure(acc.Root, triedb)
|
||||
if err != nil {
|
||||
log.Error("Failed to open storage trie", "root", acc.Root, "err", err)
|
||||
return errors.New("missing storage trie")
|
||||
@@ -426,18 +463,10 @@ func traverseRawState(ctx *cli.Context) error {
|
||||
// Check the present for non-empty hash node(embedded node doesn't
|
||||
// have their own hash).
|
||||
if node != (common.Hash{}) {
|
||||
blob := rawdb.ReadTrieNode(chaindb, node)
|
||||
if len(blob) == 0 {
|
||||
if !rawdb.HasTrieNode(chaindb, node) {
|
||||
log.Error("Missing trie node(storage)", "hash", node)
|
||||
return errors.New("missing storage")
|
||||
}
|
||||
hasher.Reset()
|
||||
hasher.Write(blob)
|
||||
hasher.Read(got)
|
||||
if !bytes.Equal(got, node.Bytes()) {
|
||||
log.Error("Invalid trie node(storage)", "hash", node.Hex(), "value", blob)
|
||||
return errors.New("invalid storage node")
|
||||
}
|
||||
}
|
||||
// Bump the counter if it's leaf node.
|
||||
if storageIter.Leaf() {
|
||||
@@ -547,35 +576,3 @@ func dumpState(ctx *cli.Context) error {
|
||||
"elapsed", common.PrettyDuration(time.Since(start)))
|
||||
return nil
|
||||
}
|
||||
|
||||
// checkAccount iterates the snap data layers, and looks up the given account
|
||||
// across all layers.
|
||||
func checkAccount(ctx *cli.Context) error {
|
||||
if ctx.NArg() != 1 {
|
||||
return errors.New("need <address|hash> arg")
|
||||
}
|
||||
var (
|
||||
hash common.Hash
|
||||
addr common.Address
|
||||
)
|
||||
switch len(ctx.Args()[0]) {
|
||||
case 40, 42:
|
||||
addr = common.HexToAddress(ctx.Args()[0])
|
||||
hash = crypto.Keccak256Hash(addr.Bytes())
|
||||
case 64, 66:
|
||||
hash = common.HexToHash(ctx.Args()[0])
|
||||
default:
|
||||
return errors.New("malformed address or hash")
|
||||
}
|
||||
stack, _ := makeConfigNode(ctx)
|
||||
defer stack.Close()
|
||||
chaindb := utils.MakeChainDatabase(ctx, stack, true)
|
||||
defer chaindb.Close()
|
||||
start := time.Now()
|
||||
log.Info("Checking difflayer journal", "address", addr, "hash", hash)
|
||||
if err := snapshot.CheckJournalAccount(chaindb, hash); err != nil {
|
||||
return err
|
||||
}
|
||||
log.Info("Checked the snapshot journalled storage", "time", common.PrettyDuration(time.Since(start)))
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -227,7 +227,6 @@ var AppHelpFlagGroups = []flags.FlagGroup{
|
||||
Flags: []cli.Flag{
|
||||
utils.SnapshotFlag,
|
||||
utils.BloomFilterSizeFlag,
|
||||
utils.IgnoreLegacyReceiptsFlag,
|
||||
cli.HelpFlag,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -30,7 +30,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"golang.org/x/crypto/ssh"
|
||||
"golang.org/x/crypto/ssh/agent"
|
||||
"golang.org/x/term"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
// sshClient is a small wrapper around Go's SSH client with a few utility methods
|
||||
@@ -101,7 +101,7 @@ func dial(server string, pubkey []byte) (*sshClient, error) {
|
||||
key, err := ssh.ParsePrivateKey(buf)
|
||||
if err != nil {
|
||||
fmt.Printf("What's the decryption password for %s? (won't be echoed)\n>", path)
|
||||
blob, err := term.ReadPassword(int(os.Stdin.Fd()))
|
||||
blob, err := terminal.ReadPassword(int(os.Stdin.Fd()))
|
||||
fmt.Println()
|
||||
if err != nil {
|
||||
log.Warn("Couldn't read password", "err", err)
|
||||
@@ -118,7 +118,7 @@ func dial(server string, pubkey []byte) (*sshClient, error) {
|
||||
}
|
||||
auths = append(auths, ssh.PasswordCallback(func() (string, error) {
|
||||
fmt.Printf("What's the login password for %s at %s? (won't be echoed)\n> ", username, server)
|
||||
blob, err := term.ReadPassword(int(os.Stdin.Fd()))
|
||||
blob, err := terminal.ReadPassword(int(os.Stdin.Fd()))
|
||||
|
||||
fmt.Println()
|
||||
return string(blob), err
|
||||
|
||||
@@ -34,7 +34,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/peterh/liner"
|
||||
"golang.org/x/term"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
// config contains all the configurations needed by puppeth that should be saved
|
||||
@@ -228,7 +228,7 @@ func (w *wizard) readDefaultFloat(def float64) float64 {
|
||||
// line and returns it. The input will not be echoed.
|
||||
func (w *wizard) readPassword() string {
|
||||
fmt.Printf("> ")
|
||||
text, err := term.ReadPassword(int(os.Stdin.Fd()))
|
||||
text, err := terminal.ReadPassword(int(os.Stdin.Fd()))
|
||||
if err != nil {
|
||||
log.Crit("Failed to read password", "err", err)
|
||||
}
|
||||
|
||||
@@ -1,19 +1,3 @@
|
||||
// Copyright 2021 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2021 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build !windows && !openbsd
|
||||
// +build !windows,!openbsd
|
||||
@@ -33,7 +33,6 @@ func getFreeDiskSpace(path string) (uint64, error) {
|
||||
|
||||
// Available blocks * size per block = available space in bytes
|
||||
var bavail = stat.Bavail
|
||||
// nolint:staticcheck
|
||||
if stat.Bavail < 0 {
|
||||
// FreeBSD can have a negative number of blocks available
|
||||
// because of the grace limit.
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2021 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build openbsd
|
||||
// +build openbsd
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2021 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package utils
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2021 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package utils
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ var (
|
||||
}
|
||||
RopstenFlag = cli.BoolFlag{
|
||||
Name: "ropsten",
|
||||
Usage: "Ropsten network: pre-configured proof-of-stake test network",
|
||||
Usage: "Ropsten network: pre-configured proof-of-work test network",
|
||||
}
|
||||
RinkebyFlag = cli.BoolFlag{
|
||||
Name: "rinkeby",
|
||||
@@ -257,9 +257,9 @@ var (
|
||||
Usage: "Megabytes of memory allocated to bloom-filter for pruning",
|
||||
Value: 2048,
|
||||
}
|
||||
OverrideGrayGlacierFlag = cli.Uint64Flag{
|
||||
Name: "override.grayglacier",
|
||||
Usage: "Manually specify Gray Glacier fork-block, overriding the bundled setting",
|
||||
OverrideArrowGlacierFlag = cli.Uint64Flag{
|
||||
Name: "override.arrowglacier",
|
||||
Usage: "Manually specify Arrow Glacier fork-block, overriding the bundled setting",
|
||||
}
|
||||
OverrideTerminalTotalDifficulty = BigFlag{
|
||||
Name: "override.terminaltotaldifficulty",
|
||||
@@ -566,10 +566,6 @@ var (
|
||||
Name: "nocompaction",
|
||||
Usage: "Disables db compaction after import",
|
||||
}
|
||||
IgnoreLegacyReceiptsFlag = cli.BoolFlag{
|
||||
Name: "ignore-legacy-receipts",
|
||||
Usage: "Geth will start up even if there are legacy receipts in freezer",
|
||||
}
|
||||
// RPC settings
|
||||
IPCDisabledFlag = cli.BoolFlag{
|
||||
Name: "ipcdisable",
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Package utils contains internal helper functions for go-ethereum commands.
|
||||
package utils
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of go-ethereum.
|
||||
//
|
||||
// go-ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// go-ethereum is distributed in the hope that it will be useful,
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Package utils contains internal helper functions for go-ethereum commands.
|
||||
package utils
|
||||
|
||||
@@ -17,6 +17,14 @@
|
||||
// Package compiler wraps the Solidity and Vyper compiler executables (solc; vyper).
|
||||
package compiler
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
var versionRegexp = regexp.MustCompile(`([0-9]+)\.([0-9]+)\.([0-9]+)`)
|
||||
|
||||
// Contract contains information about a compiled contract, alongside its code and runtime code.
|
||||
type Contract struct {
|
||||
Code string `json:"code"`
|
||||
@@ -43,3 +51,15 @@ type ContractInfo struct {
|
||||
DeveloperDoc interface{} `json:"developerDoc"`
|
||||
Metadata string `json:"metadata"`
|
||||
}
|
||||
|
||||
func slurpFiles(files []string) (string, error) {
|
||||
var concat bytes.Buffer
|
||||
for _, file := range files {
|
||||
content, err := os.ReadFile(file)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
concat.Write(content)
|
||||
}
|
||||
return concat.String(), nil
|
||||
}
|
||||
|
||||
@@ -14,14 +14,26 @@
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Package compiler wraps the ABI compilation outputs.
|
||||
// Package compiler wraps the Solidity and Vyper compiler executables (solc; vyper).
|
||||
package compiler
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Solidity contains information about the solidity compiler.
|
||||
type Solidity struct {
|
||||
Path, Version, FullVersion string
|
||||
Major, Minor, Patch int
|
||||
ExtraAllowedPath []string
|
||||
}
|
||||
|
||||
// --combined-output format
|
||||
type solcOutput struct {
|
||||
Contracts map[string]struct {
|
||||
@@ -47,6 +59,109 @@ type solcOutputV8 struct {
|
||||
Version string
|
||||
}
|
||||
|
||||
func (s *Solidity) allowedPaths() string {
|
||||
paths := []string{".", "./", "../"} // default to support relative paths
|
||||
if len(s.ExtraAllowedPath) > 0 {
|
||||
paths = append(paths, s.ExtraAllowedPath...)
|
||||
}
|
||||
return strings.Join(paths, ", ")
|
||||
}
|
||||
|
||||
func (s *Solidity) makeArgs() []string {
|
||||
p := []string{
|
||||
"--combined-json", "bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc",
|
||||
"--optimize", // code optimizer switched on
|
||||
"--allow-paths", s.allowedPaths(),
|
||||
}
|
||||
if s.Major > 0 || s.Minor > 4 || s.Patch > 6 {
|
||||
p[1] += ",metadata,hashes"
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
// SolidityVersion runs solc and parses its version output.
|
||||
func SolidityVersion(solc string) (*Solidity, error) {
|
||||
if solc == "" {
|
||||
solc = "solc"
|
||||
}
|
||||
var out bytes.Buffer
|
||||
cmd := exec.Command(solc, "--version")
|
||||
cmd.Stdout = &out
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
matches := versionRegexp.FindStringSubmatch(out.String())
|
||||
if len(matches) != 4 {
|
||||
return nil, fmt.Errorf("can't parse solc version %q", out.String())
|
||||
}
|
||||
s := &Solidity{Path: cmd.Path, FullVersion: out.String(), Version: matches[0]}
|
||||
if s.Major, err = strconv.Atoi(matches[1]); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if s.Minor, err = strconv.Atoi(matches[2]); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if s.Patch, err = strconv.Atoi(matches[3]); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
// CompileSolidityString builds and returns all the contracts contained within a source string.
|
||||
func CompileSolidityString(solc, source string) (map[string]*Contract, error) {
|
||||
if len(source) == 0 {
|
||||
return nil, errors.New("solc: empty source string")
|
||||
}
|
||||
s, err := SolidityVersion(solc)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return s.CompileSource(source)
|
||||
}
|
||||
|
||||
// CompileSolidity compiles all given Solidity source files.
|
||||
func CompileSolidity(solc string, sourcefiles ...string) (map[string]*Contract, error) {
|
||||
if len(sourcefiles) == 0 {
|
||||
return nil, errors.New("solc: no source files")
|
||||
}
|
||||
s, err := SolidityVersion(solc)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return s.CompileFiles(sourcefiles...)
|
||||
}
|
||||
|
||||
// CompileSource builds and returns all the contracts contained within a source string.
|
||||
func (s *Solidity) CompileSource(source string) (map[string]*Contract, error) {
|
||||
args := append(s.makeArgs(), "--")
|
||||
cmd := exec.Command(s.Path, append(args, "-")...)
|
||||
cmd.Stdin = strings.NewReader(source)
|
||||
return s.run(cmd, source)
|
||||
}
|
||||
|
||||
// CompileFiles compiles all given Solidity source files.
|
||||
func (s *Solidity) CompileFiles(sourcefiles ...string) (map[string]*Contract, error) {
|
||||
source, err := slurpFiles(sourcefiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
args := append(s.makeArgs(), "--")
|
||||
cmd := exec.Command(s.Path, append(args, sourcefiles...)...)
|
||||
return s.run(cmd, source)
|
||||
}
|
||||
|
||||
func (s *Solidity) run(cmd *exec.Cmd, source string) (map[string]*Contract, error) {
|
||||
var stderr, stdout bytes.Buffer
|
||||
cmd.Stderr = &stderr
|
||||
cmd.Stdout = &stdout
|
||||
if err := cmd.Run(); err != nil {
|
||||
return nil, fmt.Errorf("solc: %v\n%s", err, stderr.Bytes())
|
||||
}
|
||||
return ParseCombinedJSON(stdout.Bytes(), source, s.Version, s.Version, strings.Join(s.makeArgs(), " "))
|
||||
}
|
||||
|
||||
// ParseCombinedJSON takes the direct output of a solc --combined-output run and
|
||||
// parses it into a map of string contract name to Contract structs. The
|
||||
// provided source, language and compiler version, and compiler options are all
|
||||
|
||||
78
common/compiler/solidity_test.go
Normal file
78
common/compiler/solidity_test.go
Normal file
@@ -0,0 +1,78 @@
|
||||
// Copyright 2015 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package compiler
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"testing"
|
||||
)
|
||||
|
||||
const (
|
||||
testSource = `
|
||||
pragma solidity >0.0.0;
|
||||
contract test {
|
||||
/// @notice Will multiply ` + "`a`" + ` by 7.
|
||||
function multiply(uint a) public returns(uint d) {
|
||||
return a * 7;
|
||||
}
|
||||
}
|
||||
`
|
||||
)
|
||||
|
||||
func skipWithoutSolc(t *testing.T) {
|
||||
if _, err := exec.LookPath("solc"); err != nil {
|
||||
t.Skip(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSolidityCompiler(t *testing.T) {
|
||||
skipWithoutSolc(t)
|
||||
|
||||
contracts, err := CompileSolidityString("", testSource)
|
||||
if err != nil {
|
||||
t.Fatalf("error compiling source. result %v: %v", contracts, err)
|
||||
}
|
||||
if len(contracts) != 1 {
|
||||
t.Errorf("one contract expected, got %d", len(contracts))
|
||||
}
|
||||
c, ok := contracts["test"]
|
||||
if !ok {
|
||||
c, ok = contracts["<stdin>:test"]
|
||||
if !ok {
|
||||
t.Fatal("info for contract 'test' not present in result")
|
||||
}
|
||||
}
|
||||
if c.Code == "" {
|
||||
t.Error("empty code")
|
||||
}
|
||||
if c.Info.Source != testSource {
|
||||
t.Error("wrong source")
|
||||
}
|
||||
if c.Info.CompilerVersion == "" {
|
||||
t.Error("empty version")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSolidityCompileError(t *testing.T) {
|
||||
skipWithoutSolc(t)
|
||||
|
||||
contracts, err := CompileSolidityString("", testSource[4:])
|
||||
if err == nil {
|
||||
t.Errorf("error expected compiling source. got none. result %v", contracts)
|
||||
}
|
||||
t.Logf("error: %v", err)
|
||||
}
|
||||
3
common/compiler/test.v.py
Normal file
3
common/compiler/test.v.py
Normal file
@@ -0,0 +1,3 @@
|
||||
@public
|
||||
def test():
|
||||
hello: int128
|
||||
3
common/compiler/test_bad.v.py
Normal file
3
common/compiler/test_bad.v.py
Normal file
@@ -0,0 +1,3 @@
|
||||
lic
|
||||
def test():
|
||||
hello: int128
|
||||
144
common/compiler/vyper.go
Normal file
144
common/compiler/vyper.go
Normal file
@@ -0,0 +1,144 @@
|
||||
// Copyright 2019 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Package compiler wraps the Solidity and Vyper compiler executables (solc; vyper).
|
||||
package compiler
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Vyper contains information about the vyper compiler.
|
||||
type Vyper struct {
|
||||
Path, Version, FullVersion string
|
||||
Major, Minor, Patch int
|
||||
}
|
||||
|
||||
func (s *Vyper) makeArgs() []string {
|
||||
p := []string{
|
||||
"-f", "combined_json",
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
// VyperVersion runs vyper and parses its version output.
|
||||
func VyperVersion(vyper string) (*Vyper, error) {
|
||||
if vyper == "" {
|
||||
vyper = "vyper"
|
||||
}
|
||||
var out bytes.Buffer
|
||||
cmd := exec.Command(vyper, "--version")
|
||||
cmd.Stdout = &out
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
matches := versionRegexp.FindStringSubmatch(out.String())
|
||||
if len(matches) != 4 {
|
||||
return nil, fmt.Errorf("can't parse vyper version %q", out.String())
|
||||
}
|
||||
s := &Vyper{Path: cmd.Path, FullVersion: out.String(), Version: matches[0]}
|
||||
if s.Major, err = strconv.Atoi(matches[1]); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if s.Minor, err = strconv.Atoi(matches[2]); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if s.Patch, err = strconv.Atoi(matches[3]); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
// CompileVyper compiles all given Vyper source files.
|
||||
func CompileVyper(vyper string, sourcefiles ...string) (map[string]*Contract, error) {
|
||||
if len(sourcefiles) == 0 {
|
||||
return nil, errors.New("vyper: no source files")
|
||||
}
|
||||
source, err := slurpFiles(sourcefiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
s, err := VyperVersion(vyper)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
args := s.makeArgs()
|
||||
cmd := exec.Command(s.Path, append(args, sourcefiles...)...)
|
||||
return s.run(cmd, source)
|
||||
}
|
||||
|
||||
func (s *Vyper) run(cmd *exec.Cmd, source string) (map[string]*Contract, error) {
|
||||
var stderr, stdout bytes.Buffer
|
||||
cmd.Stderr = &stderr
|
||||
cmd.Stdout = &stdout
|
||||
if err := cmd.Run(); err != nil {
|
||||
return nil, fmt.Errorf("vyper: %v\n%s", err, stderr.Bytes())
|
||||
}
|
||||
|
||||
return ParseVyperJSON(stdout.Bytes(), source, s.Version, s.Version, strings.Join(s.makeArgs(), " "))
|
||||
}
|
||||
|
||||
// ParseVyperJSON takes the direct output of a vyper --f combined_json run and
|
||||
// parses it into a map of string contract name to Contract structs. The
|
||||
// provided source, language and compiler version, and compiler options are all
|
||||
// passed through into the Contract structs.
|
||||
//
|
||||
// The vyper output is expected to contain ABI and source mapping.
|
||||
//
|
||||
// Returns an error if the JSON is malformed or missing data, or if the JSON
|
||||
// embedded within the JSON is malformed.
|
||||
func ParseVyperJSON(combinedJSON []byte, source string, languageVersion string, compilerVersion string, compilerOptions string) (map[string]*Contract, error) {
|
||||
var output map[string]interface{}
|
||||
if err := json.Unmarshal(combinedJSON, &output); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Compilation succeeded, assemble and return the contracts.
|
||||
contracts := make(map[string]*Contract)
|
||||
for name, info := range output {
|
||||
// Parse the individual compilation results.
|
||||
if name == "version" {
|
||||
continue
|
||||
}
|
||||
c := info.(map[string]interface{})
|
||||
|
||||
contracts[name] = &Contract{
|
||||
Code: c["bytecode"].(string),
|
||||
RuntimeCode: c["bytecode_runtime"].(string),
|
||||
Info: ContractInfo{
|
||||
Source: source,
|
||||
Language: "Vyper",
|
||||
LanguageVersion: languageVersion,
|
||||
CompilerVersion: compilerVersion,
|
||||
CompilerOptions: compilerOptions,
|
||||
SrcMap: c["source_map"],
|
||||
SrcMapRuntime: "",
|
||||
AbiDefinition: c["abi"],
|
||||
UserDoc: "",
|
||||
DeveloperDoc: "",
|
||||
Metadata: "",
|
||||
},
|
||||
}
|
||||
}
|
||||
return contracts, nil
|
||||
}
|
||||
71
common/compiler/vyper_test.go
Normal file
71
common/compiler/vyper_test.go
Normal file
@@ -0,0 +1,71 @@
|
||||
// Copyright 2019 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package compiler
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func skipWithoutVyper(t *testing.T) {
|
||||
if _, err := exec.LookPath("vyper"); err != nil {
|
||||
t.Skip(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVyperCompiler(t *testing.T) {
|
||||
skipWithoutVyper(t)
|
||||
|
||||
testSource := []string{"test.v.py"}
|
||||
source, err := slurpFiles(testSource)
|
||||
if err != nil {
|
||||
t.Error("couldn't read test files")
|
||||
}
|
||||
contracts, err := CompileVyper("", testSource...)
|
||||
if err != nil {
|
||||
t.Fatalf("error compiling test.v.py. result %v: %v", contracts, err)
|
||||
}
|
||||
if len(contracts) != 1 {
|
||||
t.Errorf("one contract expected, got %d", len(contracts))
|
||||
}
|
||||
c, ok := contracts["test.v.py"]
|
||||
if !ok {
|
||||
c, ok = contracts["<stdin>:test"]
|
||||
if !ok {
|
||||
t.Fatal("info for contract 'test.v.py' not present in result")
|
||||
}
|
||||
}
|
||||
if c.Code == "" {
|
||||
t.Error("empty code")
|
||||
}
|
||||
if c.Info.Source != source {
|
||||
t.Error("wrong source")
|
||||
}
|
||||
if c.Info.CompilerVersion == "" {
|
||||
t.Error("empty version")
|
||||
}
|
||||
}
|
||||
|
||||
func TestVyperCompileError(t *testing.T) {
|
||||
skipWithoutVyper(t)
|
||||
|
||||
contracts, err := CompileVyper("", "test_bad.v.py")
|
||||
if err == nil {
|
||||
t.Errorf("error expected compiling test_bad.v.py. got none. result %v", contracts)
|
||||
}
|
||||
t.Logf("error: %v", err)
|
||||
}
|
||||
@@ -27,12 +27,12 @@ import (
|
||||
// the unnecessary precision off from the formatted textual representation.
|
||||
type PrettyDuration time.Duration
|
||||
|
||||
var prettyDurationRe = regexp.MustCompile(`\.[0-9]{4,}`)
|
||||
var prettyDurationRe = regexp.MustCompile(`\.[0-9]+`)
|
||||
|
||||
// String implements the Stringer interface, allowing pretty printing of duration
|
||||
// values rounded to three decimals.
|
||||
func (d PrettyDuration) String() string {
|
||||
label := time.Duration(d).String()
|
||||
label := fmt.Sprintf("%v", time.Duration(d))
|
||||
if match := prettyDurationRe.FindString(label); len(match) > 4 {
|
||||
label = strings.Replace(label, match, match[:4], 1)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019 The go-ethereum Authors
|
||||
// Copyright 2018 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -180,7 +180,7 @@ type Clique struct {
|
||||
|
||||
signer common.Address // Ethereum address of the signing key
|
||||
signFn SignerFn // Signer function to authorize hashes with
|
||||
lock sync.RWMutex // Protects the signer and proposals fields
|
||||
lock sync.RWMutex // Protects the signer fields
|
||||
|
||||
// The fields below are for testing only
|
||||
fakeDiff bool // Skip difficulty verifications
|
||||
@@ -507,8 +507,9 @@ func (c *Clique) Prepare(chain consensus.ChainHeaderReader, header *types.Header
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.lock.RLock()
|
||||
if number%c.config.Epoch != 0 {
|
||||
c.lock.RLock()
|
||||
|
||||
// Gather all the proposals that make sense voting on
|
||||
addresses := make([]common.Address, 0, len(c.proposals))
|
||||
for address, authorize := range c.proposals {
|
||||
@@ -525,14 +526,10 @@ func (c *Clique) Prepare(chain consensus.ChainHeaderReader, header *types.Header
|
||||
copy(header.Nonce[:], nonceDropVote)
|
||||
}
|
||||
}
|
||||
c.lock.RUnlock()
|
||||
}
|
||||
|
||||
// Copy signer protected by mutex to avoid race condition
|
||||
signer := c.signer
|
||||
c.lock.RUnlock()
|
||||
|
||||
// Set the correct difficulty
|
||||
header.Difficulty = calcDifficulty(snap, signer)
|
||||
header.Difficulty = calcDifficulty(snap, c.signer)
|
||||
|
||||
// Ensure the extra data has all its components
|
||||
if len(header.Extra) < extraVanity {
|
||||
@@ -669,10 +666,7 @@ func (c *Clique) CalcDifficulty(chain consensus.ChainHeaderReader, time uint64,
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
c.lock.RLock()
|
||||
signer := c.signer
|
||||
c.lock.RUnlock()
|
||||
return calcDifficulty(snap, signer)
|
||||
return calcDifficulty(snap, c.signer)
|
||||
}
|
||||
|
||||
func calcDifficulty(snap *Snapshot, signer common.Address) *big.Int {
|
||||
|
||||
@@ -45,11 +45,6 @@ var (
|
||||
maxUncles = 2 // Maximum number of uncles allowed in a single block
|
||||
allowedFutureBlockTimeSeconds = int64(15) // Max seconds from current time allowed for blocks, before they're considered future blocks
|
||||
|
||||
// calcDifficultyEip5133 is the difficulty adjustment algorithm as specified by EIP 5133.
|
||||
// It offsets the bomb a total of 11.4M blocks.
|
||||
// Specification EIP-5133: https://eips.ethereum.org/EIPS/eip-5133
|
||||
calcDifficultyEip5133 = makeDifficultyCalculator(big.NewInt(11_400_000))
|
||||
|
||||
// calcDifficultyEip4345 is the difficulty adjustment algorithm as specified by EIP 4345.
|
||||
// It offsets the bomb a total of 10.7M blocks.
|
||||
// Specification EIP-4345: https://eips.ethereum.org/EIPS/eip-4345
|
||||
@@ -339,8 +334,6 @@ func (ethash *Ethash) CalcDifficulty(chain consensus.ChainHeaderReader, time uin
|
||||
func CalcDifficulty(config *params.ChainConfig, time uint64, parent *types.Header) *big.Int {
|
||||
next := new(big.Int).Add(parent.Number, big1)
|
||||
switch {
|
||||
case config.IsGrayGlacier(next):
|
||||
return calcDifficultyEip5133(time, parent)
|
||||
case config.IsArrowGlacier(next):
|
||||
return calcDifficultyEip4345(time, parent)
|
||||
case config.IsLondon(next):
|
||||
|
||||
@@ -103,7 +103,7 @@ func TestDifficultyCalculators(t *testing.T) {
|
||||
for i := 0; i < 5000; i++ {
|
||||
// 1 to 300 seconds diff
|
||||
var timeDelta = uint64(1 + rand.Uint32()%3000)
|
||||
diffBig := new(big.Int).SetBytes(randSlice(2, 10))
|
||||
diffBig := big.NewInt(0).SetBytes(randSlice(2, 10))
|
||||
if diffBig.Cmp(params.MinimumDifficulty) < 0 {
|
||||
diffBig.Set(params.MinimumDifficulty)
|
||||
}
|
||||
|
||||
@@ -58,36 +58,36 @@ func CalcBaseFee(config *params.ChainConfig, parent *types.Header) *big.Int {
|
||||
return new(big.Int).SetUint64(params.InitialBaseFee)
|
||||
}
|
||||
|
||||
parentGasTarget := parent.GasLimit / params.ElasticityMultiplier
|
||||
var (
|
||||
parentGasTarget = parent.GasLimit / params.ElasticityMultiplier
|
||||
parentGasTargetBig = new(big.Int).SetUint64(parentGasTarget)
|
||||
baseFeeChangeDenominator = new(big.Int).SetUint64(params.BaseFeeChangeDenominator)
|
||||
)
|
||||
// If the parent gasUsed is the same as the target, the baseFee remains unchanged.
|
||||
if parent.GasUsed == parentGasTarget {
|
||||
return new(big.Int).Set(parent.BaseFee)
|
||||
}
|
||||
|
||||
var (
|
||||
num = new(big.Int)
|
||||
denom = new(big.Int)
|
||||
)
|
||||
|
||||
if parent.GasUsed > parentGasTarget {
|
||||
// If the parent block used more gas than its target, the baseFee should increase.
|
||||
// max(1, parentBaseFee * gasUsedDelta / parentGasTarget / baseFeeChangeDenominator)
|
||||
num.SetUint64(parent.GasUsed - parentGasTarget)
|
||||
num.Mul(num, parent.BaseFee)
|
||||
num.Div(num, denom.SetUint64(parentGasTarget))
|
||||
num.Div(num, denom.SetUint64(params.BaseFeeChangeDenominator))
|
||||
baseFeeDelta := math.BigMax(num, common.Big1)
|
||||
gasUsedDelta := new(big.Int).SetUint64(parent.GasUsed - parentGasTarget)
|
||||
x := new(big.Int).Mul(parent.BaseFee, gasUsedDelta)
|
||||
y := x.Div(x, parentGasTargetBig)
|
||||
baseFeeDelta := math.BigMax(
|
||||
x.Div(y, baseFeeChangeDenominator),
|
||||
common.Big1,
|
||||
)
|
||||
|
||||
return num.Add(parent.BaseFee, baseFeeDelta)
|
||||
return x.Add(parent.BaseFee, baseFeeDelta)
|
||||
} else {
|
||||
// Otherwise if the parent block used less gas than its target, the baseFee should decrease.
|
||||
// max(0, parentBaseFee * gasUsedDelta / parentGasTarget / baseFeeChangeDenominator)
|
||||
num.SetUint64(parentGasTarget - parent.GasUsed)
|
||||
num.Mul(num, parent.BaseFee)
|
||||
num.Div(num, denom.SetUint64(parentGasTarget))
|
||||
num.Div(num, denom.SetUint64(params.BaseFeeChangeDenominator))
|
||||
baseFee := num.Sub(parent.BaseFee, num)
|
||||
gasUsedDelta := new(big.Int).SetUint64(parentGasTarget - parent.GasUsed)
|
||||
x := new(big.Int).Mul(parent.BaseFee, gasUsedDelta)
|
||||
y := x.Div(x, parentGasTargetBig)
|
||||
baseFeeDelta := x.Div(y, baseFeeChangeDenominator)
|
||||
|
||||
return math.BigMax(baseFee, common.Big0)
|
||||
return math.BigMax(
|
||||
x.Sub(parent.BaseFee, baseFeeDelta),
|
||||
common.Big0,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
// Package checkpointoracle is a an on-chain light client checkpoint oracle.
|
||||
package checkpointoracle
|
||||
|
||||
//go:generate solc contract/oracle.sol --combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize -o ./ --overwrite
|
||||
//go:generate go run ../../cmd/abigen --pkg contract --out contract/oracle.go --combined-json ./combined.json
|
||||
//go:generate go run ../../cmd/abigen --sol contract/oracle.sol --pkg contract --out contract/oracle.go
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
package beacon
|
||||
|
||||
|
||||
@@ -148,13 +148,6 @@ func ExecutableDataToBlock(params ExecutableDataV1) (*types.Block, error) {
|
||||
if len(params.ExtraData) > 32 {
|
||||
return nil, fmt.Errorf("invalid extradata length: %v", len(params.ExtraData))
|
||||
}
|
||||
if len(params.LogsBloom) != 256 {
|
||||
return nil, fmt.Errorf("invalid logsBloom length: %v", len(params.LogsBloom))
|
||||
}
|
||||
// Check that baseFeePerGas is not negative or too big
|
||||
if params.BaseFeePerGas != nil && (params.BaseFeePerGas.Sign() == -1 || params.BaseFeePerGas.BitLen() > 256) {
|
||||
return nil, fmt.Errorf("invalid baseFeePerGas: %v", params.BaseFeePerGas)
|
||||
}
|
||||
header := &types.Header{
|
||||
ParentHash: params.ParentHash,
|
||||
UncleHash: types.EmptyUncleHash,
|
||||
|
||||
@@ -674,7 +674,7 @@ func (bc *BlockChain) SnapSyncCommitHead(hash common.Hash) error {
|
||||
if block == nil {
|
||||
return fmt.Errorf("non existent block [%x..]", hash[:4])
|
||||
}
|
||||
if _, err := trie.NewSecure(common.Hash{}, block.Root(), bc.stateCache.TrieDB()); err != nil {
|
||||
if _, err := trie.NewSecure(block.Root(), bc.stateCache.TrieDB()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1965,8 +1965,8 @@ func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error {
|
||||
oldChain types.Blocks
|
||||
commonBlock *types.Block
|
||||
|
||||
deletedTxs []common.Hash
|
||||
addedTxs []common.Hash
|
||||
deletedTxs types.Transactions
|
||||
addedTxs types.Transactions
|
||||
|
||||
deletedLogs [][]*types.Log
|
||||
rebirthLogs [][]*types.Log
|
||||
@@ -1976,9 +1976,7 @@ func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error {
|
||||
// Old chain is longer, gather all transactions and logs as deleted ones
|
||||
for ; oldBlock != nil && oldBlock.NumberU64() != newBlock.NumberU64(); oldBlock = bc.GetBlock(oldBlock.ParentHash(), oldBlock.NumberU64()-1) {
|
||||
oldChain = append(oldChain, oldBlock)
|
||||
for _, tx := range oldBlock.Transactions() {
|
||||
deletedTxs = append(deletedTxs, tx.Hash())
|
||||
}
|
||||
deletedTxs = append(deletedTxs, oldBlock.Transactions()...)
|
||||
|
||||
// Collect deleted logs for notification
|
||||
logs := bc.collectLogs(oldBlock.Hash(), true)
|
||||
@@ -2008,9 +2006,7 @@ func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error {
|
||||
}
|
||||
// Remove an old block as well as stash away a new block
|
||||
oldChain = append(oldChain, oldBlock)
|
||||
for _, tx := range oldBlock.Transactions() {
|
||||
deletedTxs = append(deletedTxs, tx.Hash())
|
||||
}
|
||||
deletedTxs = append(deletedTxs, oldBlock.Transactions()...)
|
||||
|
||||
// Collect deleted logs for notification
|
||||
logs := bc.collectLogs(oldBlock.Hash(), true)
|
||||
@@ -2029,7 +2025,6 @@ func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error {
|
||||
return fmt.Errorf("invalid new chain")
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure the user sees large reorgs
|
||||
if len(oldChain) > 0 && len(newChain) > 0 {
|
||||
logFn := log.Info
|
||||
@@ -2046,7 +2041,7 @@ func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error {
|
||||
} else if len(newChain) > 0 {
|
||||
// Special case happens in the post merge stage that current head is
|
||||
// the ancestor of new head while these two blocks are not consecutive
|
||||
log.Info("Extend chain", "add", len(newChain), "number", newChain[0].Number(), "hash", newChain[0].Hash())
|
||||
log.Info("Extend chain", "add", len(newChain), "number", newChain[0].NumberU64(), "hash", newChain[0].Hash())
|
||||
blockReorgAddMeter.Mark(int64(len(newChain)))
|
||||
} else {
|
||||
// len(newChain) == 0 && len(oldChain) > 0
|
||||
@@ -2059,26 +2054,22 @@ func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error {
|
||||
// Insert the block in the canonical way, re-writing history
|
||||
bc.writeHeadBlock(newChain[i])
|
||||
|
||||
// Collect the new added transactions.
|
||||
for _, tx := range newChain[i].Transactions() {
|
||||
addedTxs = append(addedTxs, tx.Hash())
|
||||
// Collect reborn logs due to chain reorg
|
||||
logs := bc.collectLogs(newChain[i].Hash(), false)
|
||||
if len(logs) > 0 {
|
||||
rebirthLogs = append(rebirthLogs, logs)
|
||||
}
|
||||
// Collect the new added transactions.
|
||||
addedTxs = append(addedTxs, newChain[i].Transactions()...)
|
||||
}
|
||||
|
||||
// Delete useless indexes right now which includes the non-canonical
|
||||
// transaction indexes, canonical chain indexes which above the head.
|
||||
indexesBatch := bc.db.NewBatch()
|
||||
for _, tx := range types.HashDifference(deletedTxs, addedTxs) {
|
||||
rawdb.DeleteTxLookupEntry(indexesBatch, tx)
|
||||
}
|
||||
|
||||
// Delete all hash markers that are not part of the new canonical chain.
|
||||
// Because the reorg function does not handle new chain head, all hash
|
||||
// markers greater than or equal to new chain head should be deleted.
|
||||
number := commonBlock.NumberU64()
|
||||
if len(newChain) > 1 {
|
||||
number = newChain[1].NumberU64()
|
||||
for _, tx := range types.TxDifference(deletedTxs, addedTxs) {
|
||||
rawdb.DeleteTxLookupEntry(indexesBatch, tx.Hash())
|
||||
}
|
||||
// Delete any canonical number assignments above the new head
|
||||
number := bc.CurrentBlock().NumberU64()
|
||||
for i := number + 1; ; i++ {
|
||||
hash := rawdb.ReadCanonicalHash(bc.db, i)
|
||||
if hash == (common.Hash{}) {
|
||||
@@ -2089,15 +2080,6 @@ func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error {
|
||||
if err := indexesBatch.Write(); err != nil {
|
||||
log.Crit("Failed to delete useless indexes", "err", err)
|
||||
}
|
||||
|
||||
// Collect the logs
|
||||
for i := len(newChain) - 1; i >= 1; i-- {
|
||||
// Collect reborn logs due to chain reorg
|
||||
logs := bc.collectLogs(newChain[i].Hash(), false)
|
||||
if len(logs) > 0 {
|
||||
rebirthLogs = append(rebirthLogs, logs)
|
||||
}
|
||||
}
|
||||
// If any logs need to be fired, do it now. In theory we could avoid creating
|
||||
// this goroutine if there are no events to fire, but realistcally that only
|
||||
// ever happens if we're reorging empty blocks, which will only happen on idle
|
||||
|
||||
@@ -51,7 +51,6 @@ type rewindTest struct {
|
||||
expHeadBlock uint64 // Block number of the expected head full block
|
||||
}
|
||||
|
||||
//nolint:unused
|
||||
func (tt *rewindTest) dump(crash bool) string {
|
||||
buffer := new(strings.Builder)
|
||||
|
||||
|
||||
@@ -150,7 +150,6 @@ func (basic *snapshotTestBasic) verify(t *testing.T, chain *BlockChain, blocks [
|
||||
}
|
||||
}
|
||||
|
||||
//nolint:unused
|
||||
func (basic *snapshotTestBasic) dump() string {
|
||||
buffer := new(strings.Builder)
|
||||
|
||||
@@ -342,6 +341,54 @@ func (snaptest *setHeadSnapshotTest) test(t *testing.T) {
|
||||
snaptest.verify(t, newchain, blocks)
|
||||
}
|
||||
|
||||
// restartCrashSnapshotTest is the test type used to test this scenario:
|
||||
// - have a complete snapshot
|
||||
// - restart chain
|
||||
// - insert more blocks with enabling the snapshot
|
||||
// - commit the snapshot
|
||||
// - crash
|
||||
// - restart again
|
||||
type restartCrashSnapshotTest struct {
|
||||
snapshotTestBasic
|
||||
newBlocks int
|
||||
}
|
||||
|
||||
func (snaptest *restartCrashSnapshotTest) test(t *testing.T) {
|
||||
// It's hard to follow the test case, visualize the input
|
||||
// log.Root().SetHandler(log.LvlFilterHandler(log.LvlTrace, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
|
||||
// fmt.Println(tt.dump())
|
||||
chain, blocks := snaptest.prepare(t)
|
||||
|
||||
// Firstly, stop the chain properly, with all snapshot journal
|
||||
// and state committed.
|
||||
chain.Stop()
|
||||
|
||||
newchain, err := NewBlockChain(snaptest.db, nil, params.AllEthashProtocolChanges, snaptest.engine, vm.Config{}, nil, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to recreate chain: %v", err)
|
||||
}
|
||||
newBlocks, _ := GenerateChain(params.TestChainConfig, blocks[len(blocks)-1], snaptest.engine, snaptest.gendb, snaptest.newBlocks, func(i int, b *BlockGen) {})
|
||||
newchain.InsertChain(newBlocks)
|
||||
|
||||
// Commit the entire snapshot into the disk if requested. Note only
|
||||
// (a) snapshot root and (b) snapshot generator will be committed,
|
||||
// the diff journal is not.
|
||||
newchain.Snapshots().Cap(newBlocks[len(newBlocks)-1].Root(), 0)
|
||||
|
||||
// Simulate the blockchain crash
|
||||
// Don't call chain.Stop here, so that no snapshot
|
||||
// journal and latest state will be committed
|
||||
|
||||
// Restart the chain after the crash
|
||||
newchain, err = NewBlockChain(snaptest.db, nil, params.AllEthashProtocolChanges, snaptest.engine, vm.Config{}, nil, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to recreate chain: %v", err)
|
||||
}
|
||||
defer newchain.Stop()
|
||||
|
||||
snaptest.verify(t, newchain, blocks)
|
||||
}
|
||||
|
||||
// wipeCrashSnapshotTest is the test type used to test this scenario:
|
||||
// - have a complete snapshot
|
||||
// - restart, insert more blocks without enabling the snapshot
|
||||
@@ -384,7 +431,7 @@ func (snaptest *wipeCrashSnapshotTest) test(t *testing.T) {
|
||||
SnapshotLimit: 256,
|
||||
SnapshotWait: false, // Don't wait rebuild
|
||||
}
|
||||
_, err = NewBlockChain(snaptest.db, config, params.AllEthashProtocolChanges, snaptest.engine, vm.Config{}, nil, nil)
|
||||
newchain, err = NewBlockChain(snaptest.db, config, params.AllEthashProtocolChanges, snaptest.engine, vm.Config{}, nil, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to recreate chain: %v", err)
|
||||
}
|
||||
|
||||
@@ -503,7 +503,7 @@ func TestReorgShortBlocks(t *testing.T) { testReorgShort(t, true) }
|
||||
func testReorgShort(t *testing.T, full bool) {
|
||||
// Create a long easy chain vs. a short heavy one. Due to difficulty adjustment
|
||||
// we need a fairly long chain of blocks with different difficulties for a short
|
||||
// one to become heavier than a long one. The 96 is an empirical value.
|
||||
// one to become heavyer than a long one. The 96 is an empirical value.
|
||||
easy := make([]int64, 96)
|
||||
for i := 0; i < len(easy); i++ {
|
||||
easy[i] = 60
|
||||
@@ -2576,7 +2576,6 @@ func TestTransactionIndices(t *testing.T) {
|
||||
t.Fatalf("failed to create temp freezer db: %v", err)
|
||||
}
|
||||
gspec.MustCommit(ancientDb)
|
||||
l := l
|
||||
chain, err = NewBlockChain(ancientDb, nil, params.TestChainConfig, ethash.NewFaker(), vm.Config{}, nil, &l)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create tester chain: %v", err)
|
||||
@@ -2602,7 +2601,6 @@ func TestTransactionIndices(t *testing.T) {
|
||||
limit = []uint64{0, 64 /* drop stale */, 32 /* shorten history */, 64 /* extend history */, 0 /* restore all */}
|
||||
tails := []uint64{0, 67 /* 130 - 64 + 1 */, 100 /* 131 - 32 + 1 */, 69 /* 132 - 64 + 1 */, 0}
|
||||
for i, l := range limit {
|
||||
l := l
|
||||
chain, err = NewBlockChain(ancientDb, nil, params.TestChainConfig, ethash.NewFaker(), vm.Config{}, nil, &l)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create tester chain: %v", err)
|
||||
@@ -2764,7 +2762,7 @@ func BenchmarkBlockChain_1x1000ValueTransferToNonexisting(b *testing.B) {
|
||||
numBlocks = 1
|
||||
)
|
||||
recipientFn := func(nonce uint64) common.Address {
|
||||
return common.BigToAddress(new(big.Int).SetUint64(1337 + nonce))
|
||||
return common.BigToAddress(big.NewInt(0).SetUint64(1337 + nonce))
|
||||
}
|
||||
dataFn := func(nonce uint64) []byte {
|
||||
return nil
|
||||
@@ -2781,7 +2779,7 @@ func BenchmarkBlockChain_1x1000ValueTransferToExisting(b *testing.B) {
|
||||
b.ResetTimer()
|
||||
|
||||
recipientFn := func(nonce uint64) common.Address {
|
||||
return common.BigToAddress(new(big.Int).SetUint64(1337))
|
||||
return common.BigToAddress(big.NewInt(0).SetUint64(1337))
|
||||
}
|
||||
dataFn := func(nonce uint64) []byte {
|
||||
return nil
|
||||
@@ -2798,7 +2796,7 @@ func BenchmarkBlockChain_1x1000Executions(b *testing.B) {
|
||||
b.ResetTimer()
|
||||
|
||||
recipientFn := func(nonce uint64) common.Address {
|
||||
return common.BigToAddress(new(big.Int).SetUint64(0xc0de))
|
||||
return common.BigToAddress(big.NewInt(0).SetUint64(0xc0de))
|
||||
}
|
||||
dataFn := func(nonce uint64) []byte {
|
||||
return nil
|
||||
@@ -3760,112 +3758,3 @@ func TestSetCanonical(t *testing.T) {
|
||||
chain.SetCanonical(canon[TriesInMemory-1])
|
||||
verify(canon[TriesInMemory-1])
|
||||
}
|
||||
|
||||
// TestCanonicalHashMarker tests all the canonical hash markers are updated/deleted
|
||||
// correctly in case reorg is called.
|
||||
func TestCanonicalHashMarker(t *testing.T) {
|
||||
var cases = []struct {
|
||||
forkA int
|
||||
forkB int
|
||||
}{
|
||||
// ForkA: 10 blocks
|
||||
// ForkB: 1 blocks
|
||||
//
|
||||
// reorged:
|
||||
// markers [2, 10] should be deleted
|
||||
// markers [1] should be updated
|
||||
{10, 1},
|
||||
|
||||
// ForkA: 10 blocks
|
||||
// ForkB: 2 blocks
|
||||
//
|
||||
// reorged:
|
||||
// markers [3, 10] should be deleted
|
||||
// markers [1, 2] should be updated
|
||||
{10, 2},
|
||||
|
||||
// ForkA: 10 blocks
|
||||
// ForkB: 10 blocks
|
||||
//
|
||||
// reorged:
|
||||
// markers [1, 10] should be updated
|
||||
{10, 10},
|
||||
|
||||
// ForkA: 10 blocks
|
||||
// ForkB: 11 blocks
|
||||
//
|
||||
// reorged:
|
||||
// markers [1, 11] should be updated
|
||||
{10, 11},
|
||||
}
|
||||
for _, c := range cases {
|
||||
var (
|
||||
db = rawdb.NewMemoryDatabase()
|
||||
gspec = &Genesis{
|
||||
Config: params.TestChainConfig,
|
||||
Alloc: GenesisAlloc{},
|
||||
BaseFee: big.NewInt(params.InitialBaseFee),
|
||||
}
|
||||
genesis = gspec.MustCommit(db)
|
||||
engine = ethash.NewFaker()
|
||||
)
|
||||
forkA, _ := GenerateChain(params.TestChainConfig, genesis, engine, db, c.forkA, func(i int, gen *BlockGen) {})
|
||||
forkB, _ := GenerateChain(params.TestChainConfig, genesis, engine, db, c.forkB, func(i int, gen *BlockGen) {})
|
||||
|
||||
// Initialize test chain
|
||||
diskdb := rawdb.NewMemoryDatabase()
|
||||
gspec.MustCommit(diskdb)
|
||||
chain, err := NewBlockChain(diskdb, nil, params.TestChainConfig, engine, vm.Config{}, nil, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create tester chain: %v", err)
|
||||
}
|
||||
// Insert forkA and forkB, the canonical should on forkA still
|
||||
if n, err := chain.InsertChain(forkA); err != nil {
|
||||
t.Fatalf("block %d: failed to insert into chain: %v", n, err)
|
||||
}
|
||||
if n, err := chain.InsertChain(forkB); err != nil {
|
||||
t.Fatalf("block %d: failed to insert into chain: %v", n, err)
|
||||
}
|
||||
|
||||
verify := func(head *types.Block) {
|
||||
if chain.CurrentBlock().Hash() != head.Hash() {
|
||||
t.Fatalf("Unexpected block hash, want %x, got %x", head.Hash(), chain.CurrentBlock().Hash())
|
||||
}
|
||||
if chain.CurrentFastBlock().Hash() != head.Hash() {
|
||||
t.Fatalf("Unexpected fast block hash, want %x, got %x", head.Hash(), chain.CurrentFastBlock().Hash())
|
||||
}
|
||||
if chain.CurrentHeader().Hash() != head.Hash() {
|
||||
t.Fatalf("Unexpected head header, want %x, got %x", head.Hash(), chain.CurrentHeader().Hash())
|
||||
}
|
||||
if !chain.HasState(head.Root()) {
|
||||
t.Fatalf("Lost block state %v %x", head.Number(), head.Hash())
|
||||
}
|
||||
}
|
||||
|
||||
// Switch canonical chain to forkB if necessary
|
||||
if len(forkA) < len(forkB) {
|
||||
verify(forkB[len(forkB)-1])
|
||||
} else {
|
||||
verify(forkA[len(forkA)-1])
|
||||
chain.SetCanonical(forkB[len(forkB)-1])
|
||||
verify(forkB[len(forkB)-1])
|
||||
}
|
||||
|
||||
// Ensure all hash markers are updated correctly
|
||||
for i := 0; i < len(forkB); i++ {
|
||||
block := forkB[i]
|
||||
hash := chain.GetCanonicalHash(block.NumberU64())
|
||||
if hash != block.Hash() {
|
||||
t.Fatalf("Unexpected canonical hash %d", block.NumberU64())
|
||||
}
|
||||
}
|
||||
if c.forkA > c.forkB {
|
||||
for i := uint64(c.forkB) + 1; i <= uint64(c.forkA); i++ {
|
||||
hash := chain.GetCanonicalHash(i)
|
||||
if hash != (common.Hash{}) {
|
||||
t.Fatalf("Unexpected canonical hash %d", i)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,13 +124,13 @@ func makeRandomIndexes(lengths []int, max int) [][]bloomIndexes {
|
||||
|
||||
// testMatcherDiffBatches runs the given matches test in single-delivery and also
|
||||
// in batches delivery mode, verifying that all kinds of deliveries are handled
|
||||
// correctly within.
|
||||
// correctly withn.
|
||||
func testMatcherDiffBatches(t *testing.T, filter [][]bloomIndexes, start, blocks uint64, intermittent bool, retrievals uint32) {
|
||||
singleton := testMatcher(t, filter, start, blocks, intermittent, retrievals, 1)
|
||||
batched := testMatcher(t, filter, start, blocks, intermittent, retrievals, 16)
|
||||
|
||||
if singleton != batched {
|
||||
t.Errorf("filter = %v blocks = %v intermittent = %v: request count mismatch, %v in singleton vs. %v in batched mode", filter, blocks, intermittent, singleton, batched)
|
||||
t.Errorf("filter = %v blocks = %v intermittent = %v: request count mismatch, %v in signleton vs. %v in batched mode", filter, blocks, intermittent, singleton, batched)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ type ChainContext interface {
|
||||
// Engine retrieves the chain's consensus engine.
|
||||
Engine() consensus.Engine
|
||||
|
||||
// GetHeader returns the header corresponding to the hash/number argument pair.
|
||||
// GetHeader returns the hash corresponding to their hash.
|
||||
GetHeader(common.Hash, uint64) *types.Header
|
||||
}
|
||||
|
||||
@@ -84,11 +84,6 @@ func GetHashFn(ref *types.Header, chain ChainContext) func(n uint64) common.Hash
|
||||
var cache []common.Hash
|
||||
|
||||
return func(n uint64) common.Hash {
|
||||
if ref.Number.Uint64() <= n {
|
||||
// This situation can happen if we're doing tracing and using
|
||||
// block overrides.
|
||||
return common.Hash{}
|
||||
}
|
||||
// If there's no hash cache yet, make one
|
||||
if len(cache) == 0 {
|
||||
cache = append(cache, ref.ParentHash)
|
||||
|
||||
@@ -31,7 +31,7 @@ import (
|
||||
// the correct fork ID.
|
||||
func TestCreation(t *testing.T) {
|
||||
mergeConfig := *params.MainnetChainConfig
|
||||
mergeConfig.MergeNetsplitBlock = big.NewInt(18000000)
|
||||
mergeConfig.MergeForkBlock = big.NewInt(15000000)
|
||||
type testcase struct {
|
||||
head uint64
|
||||
want ID
|
||||
@@ -68,10 +68,8 @@ func TestCreation(t *testing.T) {
|
||||
{12964999, ID{Hash: checksumToBytes(0x0eb440f6), Next: 12965000}}, // Last Berlin block
|
||||
{12965000, ID{Hash: checksumToBytes(0xb715077d), Next: 13773000}}, // First London block
|
||||
{13772999, ID{Hash: checksumToBytes(0xb715077d), Next: 13773000}}, // Last London block
|
||||
{13773000, ID{Hash: checksumToBytes(0x20c327fc), Next: 15050000}}, // First Arrow Glacier block
|
||||
{15049999, ID{Hash: checksumToBytes(0x20c327fc), Next: 15050000}}, // Last Arrow Glacier block
|
||||
{15050000, ID{Hash: checksumToBytes(0xf0afd0e3), Next: 0}}, // First Gray Glacier block
|
||||
{20000000, ID{Hash: checksumToBytes(0xf0afd0e3), Next: 0}}, // Future Gray Glacier block
|
||||
{13773000, ID{Hash: checksumToBytes(0x20c327fc), Next: 0}}, // First Arrow Glacier block
|
||||
{20000000, ID{Hash: checksumToBytes(0x20c327fc), Next: 0}}, // Future Arrow Glacier block
|
||||
},
|
||||
},
|
||||
// Ropsten test cases
|
||||
@@ -165,11 +163,9 @@ func TestCreation(t *testing.T) {
|
||||
{12964999, ID{Hash: checksumToBytes(0x0eb440f6), Next: 12965000}}, // Last Berlin block
|
||||
{12965000, ID{Hash: checksumToBytes(0xb715077d), Next: 13773000}}, // First London block
|
||||
{13772999, ID{Hash: checksumToBytes(0xb715077d), Next: 13773000}}, // Last London block
|
||||
{13773000, ID{Hash: checksumToBytes(0x20c327fc), Next: 15050000}}, // First Arrow Glacier block
|
||||
{15049999, ID{Hash: checksumToBytes(0x20c327fc), Next: 15050000}}, // Last Arrow Glacier block
|
||||
{15050000, ID{Hash: checksumToBytes(0xf0afd0e3), Next: 18000000}}, // First Gray Glacier block
|
||||
{18000000, ID{Hash: checksumToBytes(0x4fb8a872), Next: 0}}, // First Merge Start block
|
||||
{20000000, ID{Hash: checksumToBytes(0x4fb8a872), Next: 0}}, // Future Merge Start block
|
||||
{13773000, ID{Hash: checksumToBytes(0x20c327fc), Next: 15000000}}, // First Arrow Glacier block
|
||||
{15000000, ID{Hash: checksumToBytes(0xe3abe201), Next: 0}}, // First Merge Start block
|
||||
{20000000, ID{Hash: checksumToBytes(0xe3abe201), Next: 0}}, // Future Merge Start block
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -246,11 +242,11 @@ func TestValidation(t *testing.T) {
|
||||
// Local is mainnet Petersburg, remote is Rinkeby Petersburg.
|
||||
{7987396, ID{Hash: checksumToBytes(0xafec6b27), Next: 0}, ErrLocalIncompatibleOrStale},
|
||||
|
||||
// Local is mainnet Gray Glacier, far in the future. Remote announces Gopherium (non existing fork)
|
||||
// Local is mainnet Arrow Glacier, far in the future. Remote announces Gopherium (non existing fork)
|
||||
// at some future block 88888888, for itself, but past block for local. Local is incompatible.
|
||||
//
|
||||
// This case detects non-upgraded nodes with majority hash power (typical Ropsten mess).
|
||||
{88888888, ID{Hash: checksumToBytes(0xf0afd0e3), Next: 88888888}, ErrLocalIncompatibleOrStale},
|
||||
{88888888, ID{Hash: checksumToBytes(0x20c327fc), Next: 88888888}, ErrLocalIncompatibleOrStale},
|
||||
|
||||
// Local is mainnet Byzantium. Remote is also in Byzantium, but announces Gopherium (non existing
|
||||
// fork) at block 7279999, before Petersburg. Local is incompatible.
|
||||
|
||||
@@ -233,7 +233,7 @@ func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig
|
||||
return SetupGenesisBlockWithOverride(db, genesis, nil, nil)
|
||||
}
|
||||
|
||||
func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, overrideGrayGlacier, overrideTerminalTotalDifficulty *big.Int) (*params.ChainConfig, common.Hash, error) {
|
||||
func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, overrideArrowGlacier, overrideTerminalTotalDifficulty *big.Int) (*params.ChainConfig, common.Hash, error) {
|
||||
if genesis != nil && genesis.Config == nil {
|
||||
return params.AllEthashProtocolChanges, common.Hash{}, errGenesisNoConfig
|
||||
}
|
||||
@@ -279,8 +279,8 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, override
|
||||
}
|
||||
// Get the existing chain configuration.
|
||||
newcfg := genesis.configOrDefault(stored)
|
||||
if overrideGrayGlacier != nil {
|
||||
newcfg.GrayGlacierBlock = overrideGrayGlacier
|
||||
if overrideArrowGlacier != nil {
|
||||
newcfg.ArrowGlacierBlock = overrideArrowGlacier
|
||||
}
|
||||
if overrideTerminalTotalDifficulty != nil {
|
||||
newcfg.TerminalTotalDifficulty = overrideTerminalTotalDifficulty
|
||||
@@ -301,8 +301,8 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, override
|
||||
// apply the overrides.
|
||||
if genesis == nil && stored != params.MainnetGenesisHash {
|
||||
newcfg = storedcfg
|
||||
if overrideGrayGlacier != nil {
|
||||
newcfg.GrayGlacierBlock = overrideGrayGlacier
|
||||
if overrideArrowGlacier != nil {
|
||||
newcfg.ArrowGlacierBlock = overrideArrowGlacier
|
||||
}
|
||||
if overrideTerminalTotalDifficulty != nil {
|
||||
newcfg.TerminalTotalDifficulty = overrideTerminalTotalDifficulty
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2022 The go-ethereum Authors
|
||||
// Copyright 2021 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// Copyright 2019 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// Copyright 2019 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017 The go-ethereum Authors
|
||||
// Copyright 2019 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
package rawdb
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
package rawdb
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ func TestFreezerReadonlyValidate(t *testing.T) {
|
||||
|
||||
// Re-openening as readonly should fail when validating
|
||||
// table lengths.
|
||||
_, err = NewFreezer(dir, "", true, 2049, tables)
|
||||
f, err = NewFreezer(dir, "", true, 2049, tables)
|
||||
if err == nil {
|
||||
t.Fatal("readonly freezer should fail with differing table lengths")
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ func TestCopyFrom(t *testing.T) {
|
||||
{"foo", "bar", 8, true},
|
||||
}
|
||||
for _, c := range cases {
|
||||
os.WriteFile(c.src, content, 0600)
|
||||
os.WriteFile(c.src, content, 0644)
|
||||
|
||||
if err := copyFrom(c.src, c.dest, c.offset, func(f *os.File) error {
|
||||
if !c.writePrefix {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// Copyright 2019 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -133,7 +133,7 @@ type cachingDB struct {
|
||||
|
||||
// OpenTrie opens the main account trie at a specific root hash.
|
||||
func (db *cachingDB) OpenTrie(root common.Hash) (Trie, error) {
|
||||
tr, err := trie.NewSecure(common.Hash{}, root, db.db)
|
||||
tr, err := trie.NewSecure(root, db.db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -142,7 +142,7 @@ func (db *cachingDB) OpenTrie(root common.Hash) (Trie, error) {
|
||||
|
||||
// OpenStorageTrie opens the storage trie of an account.
|
||||
func (db *cachingDB) OpenStorageTrie(addrHash, root common.Hash) (Trie, error) {
|
||||
tr, err := trie.NewSecure(addrHash, root, db.db)
|
||||
tr, err := trie.NewSecure(root, db.db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2021 The go-ethereum Authors
|
||||
// Copyright 2020 The go-ethereum Authors
|
||||
// This file is part of the go-ethereum library.
|
||||
//
|
||||
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||
@@ -39,7 +39,7 @@ func (f stateBloomHasher) BlockSize() int { panic("not implem
|
||||
func (f stateBloomHasher) Size() int { return 8 }
|
||||
func (f stateBloomHasher) Sum64() uint64 { return binary.BigEndian.Uint64(f) }
|
||||
|
||||
// stateBloom is a bloom filter used during the state conversion(snapshot->state).
|
||||
// stateBloom is a bloom filter used during the state convesion(snapshot->state).
|
||||
// The keys of all generated entries will be recorded here so that in the pruning
|
||||
// stage the entries belong to the specific version can be avoided for deletion.
|
||||
//
|
||||
@@ -100,7 +100,7 @@ func (bloom *stateBloom) Commit(filename, tempname string) error {
|
||||
}
|
||||
f.Close()
|
||||
|
||||
// Move the temporary file into it's final location
|
||||
// Move the teporary file into it's final location
|
||||
return os.Rename(tempname, filename)
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user