Commit Graph

270 Commits

Author SHA1 Message Date
a
436493350e
Sentinel refactor (#8296)
1. changes sentinel to use an http-like interface

2. moves hexutil, crypto/blake2b, metrics packages to erigon-lib
2023-10-22 01:17:18 +02:00
Andrew Ashikhmin
d014da4dc0
Replace --override.shanghaiTime flag with --override.cancun (#7964)
Prerequisite: https://github.com/ledgerwatch/erigon-lib/pull/1067
2023-08-03 16:05:35 +02:00
racytech
2c2ccb6e27
dencun-devnet: --trusted-setup-file flag support (#7963) 2023-08-03 14:36:47 +02:00
Andrew Ashikhmin
af504f675a
Use EIP-4844 constants from erigon-lib (#7874)
Small refactoring after
https://github.com/ledgerwatch/erigon-lib/pull/1037
2023-07-11 17:53:00 +02:00
Alex Sharov
69ae999059
log file unmap/close errors (#7819) 2023-07-06 11:12:26 +07:00
battlmonstr
ecc1514321
crypto: a few extra tests (#7795)
* crypto: keccak256 tests
* crypto: ecies decrypt test
2023-06-29 14:51:30 +02:00
Andrew Ashikhmin
a5886732b9
Use BitLenToByteLen from erigon-lib (#7735) 2023-06-14 14:48:16 +02:00
Roberto Bayardo
d0a6d20ca2
update kzg dependencies (#7432)
Update to latest erigon-lib which now has the kzg context and update
crate-crypto to latest.

---------

Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
2023-05-04 10:36:26 +07:00
ledgerwatch
57f051f04c
Update btcd library version (#7316)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-04-16 09:50:54 +00:00
racytech
6f18ba1458
eip-4844: BlobTx and its components (#7262)
New transaction type added. This transaction differs from previous
transactions in a network encoding. Network encoding of a new
transaction wraps "regular" transaction with additional data: blobs and
kzgs. The network wrapper will be verified by execution layer using this
extra data.
2023-04-07 20:08:14 +00:00
Alex Sharov
a8e8bf4528
remove simd lib, because it doesn't work with ghcr.io/goreleaser/goreleaser-cross (which producing release binaries) (#7229)
@shyba hi, seems this lib doesn't work with
ghcr.io/goreleaser/goreleaser-cross (which producing release binaries)
removing it for now, feel free to add it in future - if can make it work
with goreleaser-cross
see: https://github.com/ledgerwatch/erigon/issues/7210
2023-03-31 05:07:43 +00:00
Alex Sharov
157a380be7
e3: history no auto-increment (#7097) 2023-03-15 08:03:57 +00:00
Victor Shyba
158fb2b606
Optimize memory buffer, simplify set32, use sha256-simd (#7060)
Hi,

I'm syncing Gnosis on a Celeron N5100 to get familiar with the codebase.
In the process I managed to optimize some things from profiling.
Since I'm not yet on the project Discord, I decided to open this PR as a
suggestion. This pass all tests here and gave me a nice boost for that
platform, although I didn't have time to benchmark it yet.

* reuse VM Memory objects with sync.Pool. It starts with 4k as `evmone`
[code
suggested](0897edb001/lib/evmone/execution_state.hpp (L49))
as a good value.
* set32 simplification: mostly cosmetic
* sha256-simd: Celeron has SHA instructions. We should probably do the
same for torrent later, but this already helped as it is very CPU bound
on such a low end processor. Maybe that helps ARM as well.
2023-03-14 07:17:04 +00:00
hexoscott
7dcbfbc283
reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
Alex Sharov
63b88c7d16
use crypto pool (#6197) 2022-12-04 11:59:02 +07:00
Alex Sharov
16cd87748f
E3: fix unwind changes visibility (#6147) 2022-11-30 08:31:13 +07:00
Alex Sharov
351cd49c21
go1.19 gofmt (#4988) 2022-08-10 19:04:13 +07:00
Leonard Chinonso
592fe32217
Refactoring To Increase Code Quality (#4842)
* General cleanup and fixes

* Cleaning part 2

* cleanup part 3

* Refactored staterunner to have a handler function

* Fixed linting

* Cleanup part 4

* Changed the initialization of the require package and updated .golangci.yml

* Fixed lint errors from golangci-lint

* deleted state_recon_1.go

* fixed build error

* Added ReadHeaderTimeouts for httpServer

* made changes to golangci

* Reset golangci.yml
2022-08-04 20:23:00 +07:00
battlmonstr
620d65ef10
crypto: MarshalPubkey unit test (#4846) 2022-07-28 09:23:58 +07:00
Håvard Anda Estensen
0a75065e7a
Use go:build lines and remove obsolete +build lines (#4175) 2022-05-17 14:46:53 +07:00
Håvard Anda Estensen
6844e74ad2
Replace ioutil with io and os (#3946) 2022-04-23 15:43:00 +01:00
battlmonstr
930d662f21
Refactor crypto.FromECDSAPub to MarshalPubkey/Std (#3797)
Most places that used this method were cutting off the 1st byte.
Refactor this idea to a common place.

* better naming: MarshalPubkey matches existing UnmarshalPubkey
* "Std" suffix for the ANSI standard encoding without cut off
* docs
2022-03-31 11:06:20 +07:00
Giulio rebuffo
b49381821f
Fixed get-payload and Hanging ForkChoice (#3575)
* done

* removed sleep

* f

* errors.Is(err, io.EOF) instead of err == io.EOF

Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
2022-02-22 14:47:23 +01:00
Frojdi Dymylja
499c27d2e1
change: port js tracer changes (#3128)
* change: expose callCtx as ScopeContext

* change: update tracer API

* change: logger API
update: jst tracer

* add: port jst tracer 2

* add: port jst tracer 3

* add: access list tracer

* chore: lint
2021-12-15 13:19:58 +00:00
Alex Sharov
da00e949c4
RemoteRPC: coherentCache for kv.Code; LocalRPC: enable small blocksLRU (#2815) 2021-10-12 12:04:04 +07:00
Giulio rebuffo
b85c5f40e2
added senders pruning (#2634) 2021-09-08 08:38:58 +07:00
Alex Sharov
ecf0f6c2f0
remove signify package (#2404) 2021-07-20 13:48:53 +07:00
Alex Sharov
a79b3cd6eb
unify stage params (#2384) 2021-07-17 09:09:56 +07:00
Alex Sharov
858fb3f503
mainnet london block and port some go-ethereum fixes related to baseFee (#2323) 2021-07-09 16:54:06 +07:00
ledgerwatch
7baf3ec484
Move secp256k1 into a separate go module, hook up erigon-lib (#2239)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2021-06-26 15:03:05 +01:00
Alex Sharov
1f13f73045
up version of uint256 lib (#2082)
* eip 1559_tx_constraints

* eip 1559_tx_constraints

* return error on uint256 overflow

* up uint256 version

* merge master

* fix master

Co-authored-by: ledgerwatch <akhounov@gmail.com>
2021-06-04 17:25:28 +01:00
Alex Sharov
0be3044b7e
rename (#1978)
* rename

* rename "make grpc"

* rename "abi bindings templates"

* rename "abi bindings templates"
2021-05-20 19:25:53 +01:00
Artem Vorotnikov
9b8cdc0f22
Fix lints and remove more unused code (#1621) 2021-03-29 10:58:45 +07:00
Igor Mandrigin
a122920fa8 and more lint fixes 2021-03-18 11:53:34 +01:00
Alexey Sharp
0275ff5369 Lint fixes 2021-03-17 20:45:33 +00:00
Alexey Sharp
519b19f8aa Compilation fixes 2021-03-14 08:00:37 +00:00
Alex Prut
1fb76cca04 all: remove unneeded parentheses (#21921)
* remove uneeded convertion type

* remove redundant type in composite literal

* omit explicit type where implicit

* remove unused redundant parenthesis

* remove redundant import alias duktape
# Conflicts:
#	core/state/snapshot/conversion.go
#	eth/tracers/tracer.go
#	metrics/cpu_syscall.go
#	trie/trie_test.go
2021-03-09 13:59:30 +01:00
Martin Holst Swende
6c3d78d0d9 core: implement background trie prefetcher
Squashed from the following commits:

core/state: lazily init snapshot storage map
core/state: fix flawed meter on storage reads
core/state: make statedb/stateobjects reuse a hasher
core/blockchain, core/state: implement new trie prefetcher
core: make trie prefetcher deliver tries to statedb
core/state: refactor trie_prefetcher, export storage tries
blockchain: re-enable the next-block-prefetcher
state: remove panics in trie prefetcher
core/state/trie_prefetcher: address some review concerns

sq

# Conflicts:
#	core/blockchain.go
#	core/state/database.go
#	core/state/state_object.go
#	core/state/statedb.go
2021-03-09 11:15:19 +01:00
Marius van der Wijden
9f29fe3ea3 crypto: fix ineffectual assignments (#22124)
* crypto/bls12381: fixed ineffectual assignment

* crypto/signify: fix ineffectual assignment
2021-03-09 10:22:15 +01:00
Martin Holst Swende
5d418f317b common,crypto: move fuzzers out of core (#22029)
* common,crypto: move fuzzers out of core

* fuzzers: move vm fuzzer out from core

* fuzzing: rework cover package logic

* fuzzers: lint
2021-03-09 10:06:00 +01:00
Felix Lange
0e87ceceed crypto/signify, build: fix archive signing with signify (#21977)
This fixes some issues in crypto/signify and makes release signing work.

The archive signing step in ci.go used getenvBase64, which decodes the key data.
This is incorrect here because crypto/signify already base64-decodes the key.
# Conflicts:
#	build/ci.go
2021-03-08 14:25:03 +01:00
Steve Ruckdashel
c5a77ff083 crypto/secp256k1: add workaround for go mod vendor (#21735)
Go won't vendor C files if there are no Go files present in the directory.
Workaround is to add dummy Go files.

Fixes: #20232
2021-03-08 12:54:31 +01:00
Guillaume Ballet
af370c6e56 crypto: signing builds with signify/minisign (#21798)
* internal/build: implement signify's signing func
* Add signify to the ci utility
* fix output file format
* Add unit test for signify
* holiman's + travis' feedback
* internal/build: verify signify's output
* crypto: move signify to common dir
* use go-minisign to verify binaries
* more holiman feedback
* crypto, ci: support minisign output
* only accept one-line trusted comments
* configurable untrusted comments
* code cleanup in tests
* revert to use ed25519 from the stdlib
* bug: fix for empty untrusted comments
* write timestamp as comment if trusted comment isn't present
* rename line checker to commentHasManyLines
* crypto: added signify fuzzer (#6)
* crypto: added signify fuzzer
* stuff
* crypto: updated signify fuzzer to fuzz comments
* crypto: repro signify crashes
* rebased fuzzer on build-signify branch
* hide fuzzer behind gofuzz build flag
* extract key data inside a single function
* don't treat \r as a newline
* travis: fix signing command line
* do not use an external binary in tests
* crypto: move signify to crypto/signify
* travis: fix formatting issue
* ci: fix linter build after package move

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
# Conflicts:
#	build/ci.go
#	go.mod
#	go.sum
2021-03-08 12:43:39 +01:00
Alex Prut
86dd1f91dd all: simplify nested complexity and if blocks ending with a return statement (#21854)
Changes:

    Simplify nested complexity
    If an if blocks ends with a return statement then remove the else nesting.

Most of the changes has also been reported in golint https://goreportcard.com/report/github.com/ethereum/go-ethereum#golint
# Conflicts:
#	cmd/utils/flags.go
#	console/bridge.go
#	crypto/bls12381/g2.go
#	les/benchmark.go
#	les/lespay/server/balance.go
#	les/lespay/server/balance_tracker.go
#	les/lespay/server/prioritypool.go
#	les/odr_requests.go
#	les/serverpool.go
#	les/serverpool_test.go
#	p2p/nodestate/nodestate_test.go
#	trie/committer.go
2021-03-08 12:34:16 +01:00
Martin Holst Swende
2f53a0856e tests/fuzzers/bls1381: add bls fuzzer (#21796)
* added bls fuzzer

* crypto/bls12381: revert bls-changes, fixup fuzzer tests

* fuzzers: split bls fuzzing into 8 different units

* fuzzers/bls: remove (now stale) corpus

* crypto/bls12381: added blsfuzz corpus

* fuzzers/bls12381: fix the bls corpus

* fuzzers: fix oss-fuzz script

* tests/fuzzers: fixups on bls corpus

* test/fuzzers: remove leftover corpus

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
# Conflicts:
#	crypto/bls12381/fp_test.go
2021-03-08 12:30:14 +01:00
Martin Holst Swende
1a5f22a76d crypto/bn256: fix bn256Mul fuzzer to not hang on large input (#21872)
* crypto/bn256: fix bn256Mul fuzzer to not hang on large input

* Update crypto/bn256/bn256_fuzz.go

Co-authored-by: ligi <ligi@ligi.de>

Co-authored-by: ligi <ligi@ligi.de>
2021-03-08 12:29:01 +01:00
Abd ar-Rahman Hamidi
ff28ab5bbc crypto/secp256k1: add checking z sign in affineFromJacobian (#18419)
The z == 0 check is hit whenever we Add two points with the same x1/x2
coordinate. crypto/elliptic uses the same check in their affineFromJacobian
function. This change does not affect block processing or tx signature verification
in any way, because it does not use the Add or Double methods.
2021-03-08 12:18:53 +01:00
Sad Pencil
510ccf4562 crypto/bn256: refine comments according to #19577, #21595, and #21836 (#21847) 2021-03-08 12:18:06 +01:00
Marius van der Wijden
e825f51b5c crypto/bn256: better comments for u, P and Order (#21836) 2021-03-08 11:42:43 +01:00
Martin Holst Swende
50b2d29ff3 crypto/bn256: improve bn256 fuzzer (#21815)
* crypto/cloudflare: fix nil deref in random G1/G2 reading

* crypto/bn256: improve fuzzer

* crypto/bn256: fix some flaws in fuzzer
2021-03-08 11:40:40 +01:00