Commit graph

21 commits

Author SHA1 Message Date
Quentin McGaw
ce2cde5662
docs(linter): comment why goheader is only enabled in the CI (#101) 2025-01-09 14:17:06 +01:00
Quentin McGaw
efa14ab5d0
chore(ci): goheader linting only runs in CI on changed or new files (#100) 2025-01-08 08:38:50 +00:00
Quentin McGaw
bee85d6171
chore(ci): define Github labels as code with a workflow (#93) 2024-12-23 15:02:52 +01:00
Arran Schlosberg
aa183c52be
refactor: generate internal Header.encodeRLP() for override (#86)
## Why this should be merged

This is a precursor to being able to override `types.Header` RLP
{en,de}coding. As there is already a `Header.EncodeRLP()` method we
either have to modify the generated code or rename the generated
method—this PR does the latter.

## How this works

The `rlpgen -internal_methods` flag changes the generated methods from
`EncodeRLP()` and `DecodeRLP()` to `encodeRLP()` and `decodeRLP()`,
respectively. A new CI job checks that generated code is up to date. We
can then implement our own `Header.EncodeRLP()` that either overrides or
falls back on the original.

It appears that `core/gen_genesis.go` was out of date but only because
of formatting.

## How this was tested

I deliberately excluded the change to `core/types/gen_header_rlp.go` to
confirm that the new workflow
[detects](https://github.com/ava-labs/libevm/actions/runs/12259667481/job/34202386378?pr=86#step:5:92)
the change and fails. The actual change can be inspected via the code
diff.
2024-12-11 10:20:58 +00:00
Arran Schlosberg
7d1b45b841
chore: mark upstream triedb/pathdb test flaky (#78)
## Why this should be merged

Reduce false-positive CI failures.

## How this works

Runs upstream `triedb/pathdb` test sequentially.

## How this was tested

[Inspection of
CI](https://github.com/ava-labs/libevm/actions/runs/12049469376/job/33596276893?pr=78#step:4:17)
2024-11-27 08:17:26 -08:00
Arran Schlosberg
41a2592b8c
chore: post-rename cleanup + libevm intro (#68)
## Why this should be merged

Cleans up loose ends after renaming the Go module. Also adds an
introduction to the README to explain the purpose of libevm.

## How this works

The changed hash in the workflow is just a fix (although a no-op). The
spaces after the copyright headers are to stop them from [showing up in
documentation](https://pkg.go.dev/github.com/ava-labs/libevm@v1.13.14-0.1.0-rc.1/params).

## How this was tested

n/a
2024-10-30 09:51:41 -04:00
Arran Schlosberg
dc8fc0308d
chore: run workflows on PRs+push to release branches (#67)
## Why this should be merged

These workflows are required by branch protection for release branches,
but aren't run automatically so release PRs can't currently be merged.

## How this works

Extends the `branches` filters of necessary workflows.

## How this was tested

n/a
2024-10-29 07:29:27 +00:00
Arran Schlosberg
5c6635282d
chore: CI updates for renamed module
Linter:
- Block imports of `ethereum/go-ethereum` upstream module
- Disable `goimports` checks on upstream code

Go:
- Update flaky-test regex
- Run flaky and non-flaky tests in different steps as this makes it easier to spot incorrect regex

Upstream delta:
- Use env var in workflow instead of `libevm-base` tag -> base changes atomically with the update commit
2024-10-17 13:09:06 +11:00
Arran Schlosberg
c6c85589af
feat: signed commit when renaming upstream module (#61)
## Why this should be merged

Signs commits for auto-renaming the Go module, originally introduced in
#51 with unsigned commits that can't be merged to `main`.

## How this works

Changes the commit action to use
[`ghcommit`](https://github.com/planetscale/ghcommit), which was made
specifically to allow for keyless signing (GitHub signs the commit). The
workflow no longer opens a PR to the `renamed-go-module` branch as it's
redundant and the generated branch can be used directly.

The commit message includes the `workflow_dispatch` trigger branch as
well as a hash of the workflow file for a complete audit trail.

I removed the commented-out PR trigger as it's unnecessary. In
development we can now just trigger the workflow on the dev branch.

## How this was tested

Inspecting [the
commit](572b8ab74e)
generated by a [workflow
run](https://github.com/ava-labs/libevm/actions/runs/11357025696/job/31589219847).
It is identical in modifications to the one reviewed in #59.
2024-10-17 12:47:06 +11:00
Arran Schlosberg
21122c043a
fix: run renaming workflow if branch == main (#58)
## Why this should be merged

#51 had a bug when checking whether or not to open a PR. I was
originally blocking everything if _not_ on main instead of doing
something if on it. The [manually dispatched run therefore didn't open a
PR as
expected](https://github.com/ava-labs/libevm/actions/runs/11299366394/job/31430160561).

## How this works

Change `!=` to `==`

## How this was tested

n/a

Signed-off-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com>
2024-10-11 17:35:31 -04:00
Arran Schlosberg
a8cc7bd033
feat: GitHub action to rename module (#51)
## Why this should be merged

Automate renaming of the Go module from
`github.com/ethereum/go-ethereum` to `github.com/ava-labs/libevm`.

## How this works

Before starting this PR, I branched the `renamed-go-module` branch off
`master` (the upstream geth branch; our default is called `main`). It
has been protected to require PRs, which are automatically generated by
the workflow introduced in this PR.

The new workflow is designed to be manually dispatched with an input
string of the commit hash to use as a source for renaming. On dispatch,
it:

1. Checks out the source commit;
2. Renames the module;
3. Makes all necessary internal changes (e.g. import renaming);
4. Runs [smoke
tests](https://en.wikipedia.org/wiki/Smoke_testing_(software));
5. Commits the changes to a new branch; and
6. Opens a PR to merge the new branch into `renamed-go-module`.

### Intended usage

When performing an upstream sync to pull in new geth code, this workflow
will first be run against the geth commit we intend to merge. After the
generated PR is merged, the `renamed-go-module` branch will be the one
incorporated into `main`.

Note that the `renamed-go-module` branch requires _two_ reviewers to
approve. The user who dispatches the workflow SHOULD be one, with any
other valid reviewer as the other. This is because a single-reviewer
workflow would allow any user to update the `renamed-go-module` branch
because the PR author is `github-actions`.

## How this was tested

Inspection of the generated PR #57 as well as the [workflow run that
generated
it](https://github.com/ava-labs/libevm/actions/runs/11298471240/job/31427495426).
2024-10-11 13:30:55 -07:00
Arran Schlosberg
88c00c6801
chore: cleanup after repo and default-branch renames (#55)
* chore: update GitHub workflow refs to `main` branch

* chore: update README reference to old repo path

* chore: exclude `README.md` from `libevm-delta` workflow
2024-10-11 10:29:32 -07:00
Arran Schlosberg
51cd795878
fix: vm.WithUNSAFECallerAddressProxying under DELEGATECALL (#50)
* fix: `vm.WithUNSAFECallerAddressProxying` under `DELEGATECALL`

* test: `vm.WithUNSAFECallerAddressProxying()` effect on outgoing caller addr

* chore: mark `eth/tracers/js` test flaky

* feat: `vm.PrecompileEnvironment.IncomingCallType()`

* chore: minor documentation edit

* doc: `PrecompileEnvironment` example for determining actual caller

* chore: placate the linter
2024-10-07 12:46:14 +01:00
Arran Schlosberg
336a289f42
feat: pseudo.Type RLP round-tripping (#43)
All commits except the last two constitute PRs #43 and #44. The last two reverted files such that only changes to the `pseudo` and `ethtest` packages remain; once this is merged into the `libevm` branch then `libevm` will be merged into the branch for #44 too. Cherry-picking commits was not possible as some touched both halves of the changes; the squash-merges will, however, make this convoluted history irrelevant.

* feat: `types.StateAccount` pseudo-generic payload

* feat: registration of `StateAccount` payload type

* chore: mark `eth/tracers/logger` flaky

* chore: copyright header + `gci`

* test: lock default `types.SlimAccount` RLP encoding

* feat: `vm.SlimAccount.Extra` from `StateAccount` equiv

* chore: placate the linter

* test: `pseudo.Type.EncodeRLP()`

* test: `pseudo.Type.DecodeRLP()`

* fix: `pseudo.Type.DecodeRLP()` with non-pointer type

* feat: `pseudo.Type.IsZero()` and `Type.Equal(*Type)`

* feat: `types.StateAccountExtra.DecodeRLP()`

* chore: revert non-pseudo-package modifications

* chore: delete non-pseudo-package additions
2024-10-01 08:23:51 -07:00
Arran Schlosberg
210f8ab8e1
feat: vm.PrecompiledStatefulContract can make CALLs (#40)
* feat: `vm.PrecompiledStatefulContract` can make `CALL`s

* fix: caller propagation

* feat: precompile can override default caller in `Call()`

* refactor: `WithUNSAFEForceDelegate()` replaces `WithCaller()`

* refactor: `WithUNSAFECallerAddressProxying()` instead of `ForceDelegate`

This matches the pattern used by `ava-labs/coreth` `NativeAssetCall`.

* refactor: `type callType` replaces `rwInheritance` + `delegation` types

* refactor: abstract return-data-proxy contract bytecode

* doc: fix comments from `46346f51`

* fix: `PrecompileEnvironment.Addresses()` for all call types

* chore: readability, linting & mark upstream test flaky

* test: `PrecompileEnvironment.Call()`

* refactor: improved {read,maintain}ability

* doc: fix `evmCallArgs` example

* test: `PrecompileEnvironment.Call()` input data

* fix: write protection for non-zero call value
2024-09-30 17:26:50 +01:00
Arran Schlosberg
df322564d0
chore: workflow to print diffs vs libevm-base tag (#18)
* chore: workflow to print diffs vs `libevm-base` tag

* fix: job name

* fix: use `${{ github.ref_name }}` instead of `HEAD`

* fix: use `github.sha` instead of `github.ref_name`

* fix: `fetch-tags: true`

* chore: fml

* fix: `fetch-depth: 0` for more than just 1 commit

* fix: check out branch before performing diff

* chore: `set -x` to aid debugging

* fix: add `--` suffix to `git checkout`

* fix: use `github.ref_name` instead of `github.sha`

* refactor: move all actions inside workflow

* fix: use `github.ref` for full name

* fix: only use explicit diff for `libevm`

* chore: `git diff --color=always`

* feat: color-blindness a11y
2024-09-14 09:33:20 +01:00
Arran Schlosberg
04543ea837
chore: golangci-lint CI workflow (#16)
* chore: `golangci-lint` CI workflow

* fix: make `golangci-lint` happy

* chore: bump `actions/{checkout,setup-go}` versions

* chore: overhaul `.golanci.yml` config

* fix: all linter issues

* chore: exclude non-libevm linters + change deprecated option

* fix: add overflow check in example

* fix: try again; different local version?

* chore: this is trying my patience

* chore: enable `gci` and fix ordering

* chore: mark `ethclient/gethclient` test as flaky

* chore: mark `eth/catalyst` test as flaky
2024-09-12 20:31:04 +01:00
Arran Schlosberg
2d3894fb97
fix: run flaky upstream tests sequentially (#15)
* fix: run flaky upstream tests sequentially

* chore: run flaky tests first to fail early

There are fewer of them so they'll fail quickly and allow the CI run to just be restarted.
2024-09-12 19:53:38 +01:00
Arran Schlosberg
b6f3eb9093
chore: basic CI (#9)
* chore: Go CI runs on `libevm` branch

* fix: stop using `reflect.TypeFor[T]()`

* chore: rename job, remove flaky tests, and clear `GOOS`+`GOARCH`

* fix: PR branch was `libem`

* chore: rename workflow

* chore: disable flaky `accounts/keystore` test
2024-09-10 20:52:25 +01:00
Sina Mahmoodi
a608c0ac84
cmd/devp2p/internal/ethtest: skip large tx test on github build (#28794)
This test was failling consistently on the github 32-bit build probably due to slow IO. Skipping it for that green check.
2024-01-12 15:14:03 +01:00
Guillaume Ballet
69576df254
.github: use github actions to run 32-bit linux tests (#28549)
use github actions to run 32-bit linux tests
2023-12-05 14:45:40 +01:00