Skip to content

Commit c611bb3

Browse files
feat(nibiru): Move to geth v1.13 (#7)
* Sync to exact code state of go-ethereum v1.13.15 to see what breaks in Nibiru * docs: function documentation for signer constructor * Sync all files with upstream v1.13.15 * Pull in changes from 06312f9 * feat(vm): Restore EVM context in PrecompiledContract interface Upstream go-ethereum v1.13 refactored the PrecompiledContract interface, removing the `*vm.EVM`, `*vm.Contract`, and `readonly bool` parameters from the `Run` method signature (`Run(input []byte)`). The `Address()` method was also removed from the precompile structs, and the `RunPrecompiledContract` helper function was updated accordingly. While this simplifies the interface for standard EVM precompiles, Nibiru Chain utilizes custom precompiles (e.g., for Wasm contract interaction) that require access to the underlying Cosmos SDK state and keepers. This access is facilitated by deriving an `sdk.Context` from the `vm.EVM`'s `StateDB`. This commit reverts these specific interface and implementation changes to maintain compatibility with Nibiru's custom precompiles: - Restored the `Run(*EVM, *Contract, bool)` signature to the `vm.PrecompiledContract` interface. - Added the `Address() common.Address` method back to the interface. - Re-implemented the `Address()` method for all standard precompile structs. - Reverted the `vm.RunPrecompiledContract` helper function to accept the EVM, caller, value, and readonly context and pass it to the precompile's `Run` method, including logic to construct the necessary `Contract` object. - Updated the standard precompile implementations (`ecrecover`, `sha256hash`, `ripemd160hash`, `dataCopy`, `bigModExp`, `bn256*`, `blake2F`, `bls*`, `kzgPointEvaluation`) to match the reverted `Run` signature, allowing them to compile and function alongside custom precompiles expecting the older interface. - Updated EVM call methods (`Call`, `CallCode`, `DelegateCall`, `StaticCall`) to use the reverted `RunPrecompiledContract` signature. - Updated relevant tests and fuzzers to align with the reverted signatures. This change allows Nibiru's precompiles to continue accessing the required Cosmos SDK context via the `vm.EVM` object provided during execution. * feat(common): add back Hash function * fix(sorting): This commit removes usage of `golang.org/x/exp/slices.SortFunc` throughout the codebase and replaces it with equivalent calls to `sort.Slice` from the Go standard library. This change improves build stability across Go versions and ensures compatibility with the project’s explicitly declared `go 1.20` toolchain. - `slices.SortFunc` relies on generic type inference and comparator functions returning `int`, which introduces inconsistencies and build failures under newer Go versions (e.g., 1.21+), especially when function signatures drift or implicit type inference fails. - `sort.Slice` is stable, well-understood, and idiomatic for sorting slices in-place using `bool`-returning comparators. - This replacement avoids upgrading Go beyond version 1.20, preserving build correctness and minimizing future toolchain-related bugs. - Avoids unnecessary dependencies on `golang.org/x/exp`, which is not guaranteed to be stable. - For all `slices.SortFunc(...)` calls, equivalent `sort.Slice(...)` expressions were used. - Where the previous comparator used `Cmp` or custom integer return values, those were mapped to `bool` conditions consistent with sort order expectations. - All test files and logic remain functionally unchanged aside from the sorting mechanism. This refactor maintains semantic equivalence while improving long-term maintainability and version safety.
1 parent 6231a0a commit c611bb3

File tree

1,420 files changed

+118338
-91889
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,420 files changed

+118338
-91889
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ accounts/usbwallet @karalabe
55
accounts/scwallet @gballet
66
accounts/abi @gballet @MariusVanDerWijden
77
cmd/clef @holiman
8-
cmd/puppeth @karalabe
98
consensus @karalabe
109
core/ @karalabe @holiman @rjl493456442
1110
eth/ @karalabe @holiman @rjl493456442
1211
eth/catalyst/ @gballet
1312
eth/tracers/ @s1na
14-
graphql/ @gballet @s1na
13+
graphql/ @s1na
1514
les/ @zsfelfoldi @rjl493456442
1615
light/ @zsfelfoldi @rjl493456442
17-
mobile/ @karalabe @ligi
1816
node/ @fjl
1917
p2p/ @fjl @zsfelfoldi
2018
rpc/ @fjl @holiman

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ and help.
3535

3636
## Configuration, dependencies, and tests
3737

38-
Please see the [Developers' Guide](https://geth.ethereum.org/docs/developers/devguide)
38+
Please see the [Developers' Guide](https://geth.ethereum.org/docs/developers/geth-developer/dev-guide)
3939
for more details on configuring your environment, managing project dependencies
4040
and testing procedures.

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ assignees: ''
99
#### System information
1010

1111
Geth version: `geth version`
12+
CL client & version: e.g. lighthouse/nimbus/[email protected]
1213
OS & Version: Windows/Linux/OSX
1314
Commit hash : (if `develop`)
1415

@@ -27,4 +28,4 @@ Commit hash : (if `develop`)
2728
[backtrace]
2829
````
2930

30-
When submitting logs: please submit them as text and not screenshots.
31+
When submitting logs: please submit them as text and not screenshots.

.github/workflows/build.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/dependencies.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/go.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: i386 linux tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: self-hosted
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Go
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: 1.21.4
19+
- name: Run tests
20+
run: go test -short ./...
21+
env:
22+
GOOS: linux
23+
GOARCH: 386

.github/workflows/lint.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

.github/workflows/markdown-links.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/security.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/super-linter.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)