Commit graph

68 commits

Author SHA1 Message Date
Daniel Liu
e250435851
fix(crypto): remove keccak_ziren.go (#2113) 2026-03-03 11:15:42 +08:00
Daniel Liu
cf99bd07ff
refactor(node): use standalone flock dependency #19376 #26633 (#1993)
* refactor(node): switching prometheus flock location to tsdb #19376

* refactor(node): use standalone flock dependency #26633
2026-02-10 16:41:27 +05:30
Daniel Liu
99749a2381
feat(crypto): use the ziren keccak precompile and implement ziren keccak state #32816 #32996 (#1991)
* feat(crypto): use the ziren keccak precompile #32816

Uses the go module's `replace` directive to delegate keccak computation
to precompiles.

This is still in draft because it needs more testing. Also, it relies on
a PR that I created, that hasn't been merged yet.

_Note that this PR doesn't implement the stateful keccak state
structure, and it reverts to the current behavior. This is a bit silly
since this is what is used in the tree root computation. The runtime
doesn't currently export the sponge. I will see if I can fix that in a
further PR, but it is going to take more time. In the meantime, this is
a useful first step_

* feat(crypto): implement ziren keccak state #32996

The #32816 was only using the keccak precompile for some minor task.
This PR implements a keccak state, which is what is used for hashing the
tree.

---------

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2026-02-05 14:43:53 +05:30
Daniel Liu
b5e617fee0
internal/debug: add integration with Grafana Pyroscope #33623 (#1983) 2026-01-29 11:22:03 +05:30
wanwiset25
fe275a9459 update package version:
github.com/btcsuite/btcd
2025-10-07 15:28:17 +04:00
Daniel Liu
458f6582e7
build/tools, go.mod: remove go-bindata #24744 (#1512) 2025-09-17 08:41:41 +08:00
wit765
f234dd896e
build: upgrade go to v1.25.1 (#1476)
Co-authored-by: wit <wit765765346@gmail>
2025-09-11 16:35:39 +08:00
Daniel Liu
88d703180c
eth/tracers/js: drop duktape engine #24934 (#1283) 2025-09-08 21:11:27 +08:00
Daniel Liu
05a9e91898
cmd/abigen, accounts/abi/bind: implement abigen version 2 #31379 (#1416)
This PR implements a new version of the abigen utility (v2) which exists
along with the pre-existing v1 version.

Abigen is a utility command provided by go-ethereum that, given a
solidity contract ABI definition, will generate Go code to transact/call
the contract methods, converting the method parameters/results and
structures defined in the contract into corresponding Go types. This is
useful for preventing the need to write custom boilerplate code for
contract interactions.

Methods in the generated bindings perform encoding between Go types and
Solidity ABI-encoded packed bytecode, as well as some action (e.g.
`eth_call` or creating and submitting a transaction). This limits the
flexibility of how the generated bindings can be used, and prevents
easily adding new functionality, as it will make the generated bindings
larger for each feature added.

Abigen v2 was conceived of by the observation that the only
functionality that generated Go bindings ought to perform is conversion
between Go types and ABI-encoded packed data. Go-ethereum already
provides various APIs which in conjunction with conversion methods
generated in v2 bindings can cover all functionality currently provided
by v1, and facilitate all other previously-desired use-cases.

To generate contract bindings using abigen v2, invoke the `abigen`
command with the `--v2` flag. The functionality of all other flags is
preserved between the v2 and v1 versions.

The execution of `abigen --v2` generates Go code containing methods
which convert between Go types and corresponding ABI-encoded data
expected by the contract. For each input-accepting contract method and
the constructor, a "packing" method is generated in the binding which
converts from Go types to the corresponding packed solidity expected by
the contract. If a method returns output, an "unpacking" method is
generated to convert this output from ABI-encoded data to the
corresponding Go types.

For contracts which emit events, an unpacking method is defined for each
event to unpack the corresponding raw log to the Go type that it
represents.

Likewise, where custom errors are defined by contracts, an unpack method
is generated to unpack raw error data into a Go type.

For a smooth user-experience, abigen v2 comes with a number of utility
functions to be used in conjunction with the generated bindings for
performing common contract interaction use-cases. These include:

* filtering for historical logs of a given topic
* watching the chain for emission of logs with a given topic
* contract deployment methods
* Call/Transact methods

https://geth.ethereum.org will be updated to include a new tutorial page
for abigen v2 with full code examples. The page currently exists in a
PR: https://github.com/ethereum/go-ethereum/pull/31390 .

There are also extensive examples of interactions with contract bindings
in [test
cases](cc855c7ede/accounts/abi/bind/v2/lib_test.go)
provided with this PR.

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-09-03 15:47:12 +08:00
Daniel Liu
ae58eb9f64
go.mod: upgrade goja #23721 (#1281) 2025-08-04 11:57:13 +08:00
Daniel Liu
badb46ce2b
crypto: remove kgz4844 (#1225) 2025-07-26 17:32:07 +08:00
Daniel Liu
8f76709a10
core/vm, go.mod: update uint256 to v1.3.2 and use faster method #30868 (#1241) 2025-07-17 17:56:53 +08:00
Daniel Liu
b18f9f2705
trie: use github.com/holiman/bloomfilter/v2 #22044 (#1059) 2025-06-03 11:52:45 +08:00
Daniel Liu
f6a5d42285
rpc: use go-winio for named pipes #27972 (#1002)
We're trying a new named pipe library, which should hopefully fix some occasional failures in CI.

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-04-28 17:50:26 +08:00
JukLee0ira
230a2f09ba
cmd/geth, node, rpc: implement jwt tokens #24364 (#993)
* cmd/geth, node, rpc: implement jwt tokens #24364

* fix
2025-04-27 18:17:09 +08:00
Daniel Liu
77ad10c890 crypto/kz4844: pass blobs by ref (#29050) 2025-02-11 18:26:56 +08:00
Daniel Liu
5beff83a6d all: remove deprecated protobuf dependencies (#30232)
The package `github.com/golang/protobuf/proto` is deprecated in favor
`google.golang.org/protobuf/proto`. We should update the codes to
recommended package.

Signed-off-by: Icarus Wu <icaruswu66@qq.com>
2025-01-24 16:54:12 +08:00
Daniel Liu
13d39173b3 accounts/usbwallet: update hid library (#29176) 2025-01-24 16:54:12 +08:00
Daniel Liu
4e951ed8fe all: use github.com/deckarep/golang-set/v2 (generic set) (#26159) 2025-01-24 16:54:11 +08:00
Daniel Liu
4081ed926a accounts/keystore: replace inotify with fsnotify (#26176) 2025-01-24 16:54:11 +08:00
Daniel Liu
c75ba99267 accounts/keystore: use github.com/google/uuid (#22217)
This replaces the github.com/pborman/uuid dependency with
github.com/google/uuid because the former is only a wrapper for
the latter (since v1.0.0).

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-01-24 16:18:30 +08:00
Daniel Liu
f8c67edb64 accounts/scwallet: use go-ethereum crypto instead of go-ecdh (#22212)
* accounts/scwallet: use go-ethereum crypto instead of go-ecdh

github.com/wsddn/go-ecdh is a wrapper package for ECDH functionality
with any elliptic curve.

Since 'generic' ECDH is not required in accounts/scwallet (the curve is
always secp256k1), we can just use the standard library functionality
and our own crypto libraries to perform ECDH and save a dependency.

* Update accounts/scwallet/securechannel.go

Co-authored-by: Guillaume Ballet <gballet@gmail.com>

* Use the correct key

Co-authored-by: Guillaume Ballet <gballet@gmail.com>
2025-01-24 16:18:30 +08:00
Daniel Liu
7c3c703559 tests/fuzzers/abi: add fuzzer for fuzzing package accounts/abi (#21217)
* tests/fuzzers/abi: added abi fuzzer

* accounts/abi: fixed issues found by fuzzing

* tests/fuzzers/abi: update fuzzers, added repro test

* tests/fuzzers/abi: renamed abi_fuzzer to abifuzzer

* tests/fuzzers/abi: updated abi fuzzer

* tests/fuzzers/abi: updated abi fuzzer

* accounts/abi: minor style fix

* go.mod: added go-fuzz dependency

* tests/fuzzers/abi: updated abi fuzzer

* tests/fuzzers/abi: make linter happy

* tests/fuzzers/abi: make linter happy

* tests/fuzzers/abi: comment out false positives
2025-01-24 16:18:29 +08:00
Daniel Liu
2e21b96101 accounts/usbwallet: add webusb trezor support (#19588) 2025-01-24 16:18:29 +08:00
Daniel Liu
2999bea17f accounts: smartcard wallet without the dependency on libpcsclite (#19273) 2025-01-24 16:18:29 +08:00
Daniel Liu
588f61661c build: add imports for go generate tools (#24682) 2025-01-20 11:52:59 +08:00
Daniel Liu
1d5d2f1349 build: add 'go generate' checker 2025-01-16 08:21:42 +08:00
Daniel Liu
15be5ba464 crypto: use decred secp256k1 directly (#30595) 2025-01-04 11:00:57 +08:00
Daniel Liu
57eb92da1c common/prque: remove dependency on golang.org/exp (#29314) 2024-12-28 09:06:31 +08:00
Felföldi Zsolt
f74cccd1cb beacon/types: add beacon chain data types (#27292)
* beacon/types: add beacon chain data types

* beacon/merkle: added comments

* go.mod: cleanups

---------

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2024-12-28 09:06:31 +08:00
Péter Szilágyi
39e9d8f94d common/prque: generic priority queue (#26290) 2024-12-28 09:06:31 +08:00
Daniel Liu
6f19ace5e2 common/mclock: remove dependency on github.com/aristanetworks/goarista (#22211) 2024-12-28 09:06:30 +08:00
Daniel Liu
82ff8c19a0 all: remove uses of untyped golang-lru 2024-12-21 14:39:26 +08:00
Daniel Liu
c7565af9b8 metrics: remove dependency on golang.org/exp (#29314) 2024-12-13 14:00:14 +08:00
Daniel Liu
e524043a3b metrics: use slices package for sorting (#27493 #27909)
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-12-13 14:00:13 +08:00
Daniel Liu
6e055a601d metrics/influxdb: reuse code between v1 and v2 reporters (#26963) 2024-12-13 14:00:13 +08:00
Daniel Liu
29b72dbba6 metrics/influxdb: support V2 (#23194) 2024-12-13 14:00:12 +08:00
Daniel Liu
d7d54b00f7 metrics: replace gosigar with gopsutil (#21041) 2024-12-13 14:00:12 +08:00
Daniel Liu
1eb2ed8293 core, metrics, p2p: expose various counter metrics for grafana (#19692) 2024-12-13 14:00:11 +08:00
Daniel Liu
824dea669c crypto/kzg4844: use the new trusted setup file and format (#28383) 2024-12-09 17:49:00 +08:00
Daniel Liu
8f57d6caea go.mod: upgrade c-kzg-4844 (#27907) 2024-12-09 17:49:00 +08:00
Daniel Liu
541ddee235 go.mod: update kzg libraries to use big-endian (#27510) 2024-12-09 17:49:00 +08:00
Daniel Liu
ed03a99770 crypto/kzg4844: upgrade c-kzg-4844 to v0.2.0 (#27257) 2024-12-09 17:49:00 +08:00
Daniel Liu
bedd571091 crypto/kzg4844: pull in the C and Go libs for KZG cryptography (#27155) 2024-12-09 17:49:00 +08:00
Daniel Liu
cb3edac2c7 crypto: use btcec/v2 for no-cgo (#24533) 2024-12-09 17:49:00 +08:00
Daniel Liu
5ee26e04ed crypto/secp256k1: fix undefined behavior in BitCurve.Add (#22621) 2024-12-09 17:49:00 +08:00
Daniel Liu
7711f4b76d tests/fuzzers: crypto/bn256 tests against gnark-crypto (#22755) 2024-12-09 17:49:00 +08:00
Daniel Liu
ae95ceac41 bn256: added consensys/gurvy bn256 implementation (#21812) 2024-12-09 17:49:00 +08:00
Daniel Liu
d3fc08db1d update golang.org/x/crypto to v0.29.0 2024-12-09 17:48:59 +08:00
Daniel Liu
dcab7e8efb cmd: migrate to urfave/cli/v2 (#24751) 2024-11-25 16:39:29 +08:00