Skip to content

Commit 47449f6

Browse files
EikixparithoshfjlmarioevzRjected
authored
Feat/rebasehive (#6)
* Update besu branch back to main (ethereum#836) update besu branch back to main * cmd/hiveview: limit log bytes in suite view It was already limited to a certain number of lines, but that's not enough when the test outputs very long lines. * simulators/ethereum/engine: Fix ForkID Tests (ethereum#837) * simulators/ethereum/pyspec: go.mod: geth update * simulators/ethereum/engine: go.mod: geth update * simulators/ethereum/engine: ForkID: check no disconnect * simulators/ethereum/pyspec: fix genesis * Incorrect comment. * simulators/ethereum/engine: Add incorrect engine versions tests (ethereum#834) * simulators/ethereum/engine: use customizer interfaces * simulators/ethereum/engine: Expect generic methods * simulators/ethereum/engine: GetPayload generic methods * simulators/ethereum/engine: CLMock add callback on payload attributes * simulators/ethereum/engine: GetPayload customizers * simulators/ethereum/engine: Add tests for incorrect FcU and GetPayload versions * simulators/ethereum/engine: Add time delta modifier * simulators/ethereum/engine: Fix Cancun time increments * simulators/ethereum/engine: Add multiple FcU payload requests on different forks test * simulators/ethereum/engine: CLMock: add payload id history * simulators/ethereum/engine: Add payload id check on beacon root change * simulators/ethereum/engine: Fix test starting directly on Cancun * configs/cancun: Besu update (ethereum#841) configs: Besu cancun branch update * clients/reth: add cancun fork in mapper (ethereum#842) * clients/erigon: Fix `Dockerfile.git` (ethereum#861) clients/erigon: fix git dockerfile * simulators/ethereum/engine: Refactor Legacy Engine API Tests (ethereum#840) * Refactor previous tests to run on new forks * Fix configuration on Cancun * Fix spec fork time * Run all tests using blob transactions when possible * Allow blob transaction modifications * Add more Cancun invalid field tests * Update expected invalid detection on versioned hashes * Use multiple source accounts for test transactions by default * Get full block only when necessary * Fixes on some of the tests * Update suggested fee recipient tests * Update prev-randao tests * NewPayload Tests Refactor * Refactor last re-org tests * Simplify ForkID tests * Incorrect comment * Fix pyspec * More Versioned Hashes Tests * simulators/ethereum/engine: Beacon root pre-deploy address update (ethereum#839) simulators/ethereum/engine: Update beacon root to latest spec. * clients/reth: Dockerfile support to build Reth from git or locally (ethereum#860) * clients/besu: sh - Remove legacy option from startup flags (ethereum#863) Remove legacy tx pool option Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net> * simulators/ethereum/pyspec: update execution-spec-tests (ethereum#865) Updates execution-spec-tests version, which includes the same beacon root contract address as the existing engine-api tests * cmd/hiveview: persist column filters in URL (ethereum#864) * cmd/hiveview: avoid creating history for column filter changes (ethereum#866) * simulators/ethereum/engine: run tests in parallel (ethereum#869) sim/eth/engine: run tests in parallel * hiveproxy: upgrade dependencies * go.mod: upgrade dependencies go-ethereum v1.13 no longer provides ethash mining, so this feature had to be removed from hivechain. * go.mod: upgrade hiveproxy dependency * .circleci: use Go 1.21 * .circleci: enable internal static linking * .circleci: disable libc dependencies in CI build * simulators/devp2p: upgrade dependencies * simulators/smoke: upgrade dependencies * simulators/smoke/genesis: add some new forks * simulators/ethereum/sync: upgrade dependencies * simulators/ethereum/rpc: upgrade dependencies * simulators/ethereum/rpc-compat: upgrade dependencies * simulators/ethereum/pyspec: upgrade dependencies * simulators/ethereum/graphql: upgrade dependencies * simulators/ethereum/consensus: upgrade dependencies * simulators/ethereum/engine: upgrade dependencies Also remove the module replacement, since it should not be needed anymore. * simulators/ethereum: update Go version in go.work file * simulators/ethereum/engine: go mod tidy * simulators/ethereum/engine: Add London non-zero-number test (ethereum#867) * configs/cancun: Update Geth (ethereum#871) * simulators/ethereum/engine: Update beacon root address: 0xbEAC..7d7a (ethereum#873) * simulators/ethereum/pyspec: Use hive specific fixture format (ethereum#844) * simulators/pyspec: Update to use correct fcuVersion. * simulators/ethereum/pyspec: Refactor to use new fixture format. * simulators/ethereum/pyspec: Fix logging, tests links and go.sum. * simulators/ethereum/pyspec: fixes * simulators/ethereum/pyspec: update fixtures source --------- Co-authored-by: Mario Vega <marioevz@gmail.com> * Add reth (ethereum#875) Add reth to default cancun config * clients/prysm-vc: Fix docker args * clients/lodestar-vc: Remove builder option * clients/teku-bn: Add trusted setup file * configs/cancun: add all consensus clients * bump besu (ethereum#882) * simulators/ethereum: Update beacon root address 0x000F..Beac02 (ethereum#884) * simulators/ethereum/engine: Update beacon root address 0x000F..Beac02 * simulators/ethereum/pyspec: Download latest fixtures * simulators/ethereum/engine: Update beacon root contract * simulators/ethereum/engine: Update History buffer length Co-authored-by: spencer <spencer.taylor-brown@ethereum.org> --------- Co-authored-by: Mario Vega <marioevz@gmail.com> Co-authored-by: spencer <spencer.taylor-brown@ethereum.org> * simulators/ethereum/engine: rm 0x prefix on 4788 code (ethereum#885) * clients/erigon: Increase allowed blobcount in remote txs (ethereum#890) Increase allowed blobcount in remote txs Erigon now has a built-in spam protector for blob txs, this flag would increase the count of allowed blobs per account from the default 48 to a 1000 * simulators/ethereum/engine: use replaced version of geth with updated beacon root (ethereum#888) * simulators/ethereum/engine: use replaced version of geth with updated beacon root * simulators/ethereum/pyspec: use replaced version of geth with updated beacon root --------- Co-authored-by: Mario Vega <marioevz@gmail.com> * simulators/ethereum/engine: Engine API Test Fixes (ethereum#891) * simulators/ethereum/engine: fix non-zero pre-merge fork test * simulators/ethereum/engine: fix invalid versioned hashes tests * clients/besu: use ubuntu base image and install java (ethereum#889) use ubuntu base image and install java Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com> * simulators/ethereum/engine: Fix several tests (ethereum#886) * simulators/ethereum/engine: fix versioning tests * simulators/ethereum/engine: fix transaction replacement * simulators/ethereum/engine: CLMock: Per-client payload id map * simulators/ethereum/engine: Unique Payload ID tests in Cancun * clients/ethereumjs: Remove `transports` parameter (ethereum#892) * simulators/ethereum/engine: Fix incomplete transactions test (ethereum#893) * clients/nimbus-el: use admin_nodeInfo instead of net_nodeInfo (ethereum#896) Most/all EL client seem to use admin_nodeInfo so we adjusted this in nimbus-eth1 * simulators/ethereum/engine: Optional `INVALID` on sync * simulators/ethereum/engine: Fix invalid nonce test on zero nonce * simulators/ethereum/engine: Fix invalid Tx tests to use more realistic values * simulators/ethereum/engine: Remove blob tx on Shanghai genesis, before fork * simulators/ethereum/engine: Tx Invalid Signature Modifies S * simulators/ethereum/engine: Update post-merge forks to activate later in pre-merge test (ethereum#901) simulators/eth/engine: Update pre-merge tests. * simulators/ethereum/engine: Fix naming, safe/finalized on reorg tests (ethereum#907) * simulators/ethereum/engine: use generic error check for missing block (ethereum#874) simulators/ethereum/engine: use generic error check for missing block on rpc * clients/go-ethereum: disable min free disk check (ethereum#910) * internal/libhive: return clients in the order defined in the client-file (ethereum#898) * cmd/hivechain: support for newer forks, more chain outputs (ethereum#909) * simulators/ethereum/engine,pyspec: Update Trusted Setup (ethereum#915) * simulators/ethereum/engine: Update geth branch, use mainnet trusted setup * simulators/ethereum: go.work.sum * simulators/ethereum/pyspec: Update geth branch * configs/cancun: Update geth to devnet-10 * simulators/ethereum/engine: Send different blobs depending on the sender * cmd/hivechain: export chain starting after genesis (ethereum#912) * cmd/hivechain: write ttd passed to genesis if merged (ethereum#913) * cmd/hivechain: add forkenv output (ethereum#921) * cmd/hivechain: add HIVE_NETWORK_ID in forkenv output * cmd/hivechain: use smaller network ID jq doesn't like it when numbers are > 64bit * cmd/hivechain: even smaller chainid * cmd/hivechain: add headnewpayload output * cmd/hivechain: track preimages during generation (ethereum#924) * cmd/hivechain: remove trie/triedb/hashdb package dependency * Nethermind to use master branch (ethereum#925) * simulators/ethereum/engine,pyspec: Use `golang:1.20-alpine` (ethereum#926) * simulators/ethereum/engine: Trim log output of requests (ethereum#928) * Enable blob tx pool for Nethermind * simulators/ethereum/engine: Fix engine-cancun fcu version tests (ethereum#902) * simulators/ethereum/engine: Fix bugs within fcu version tests (Shanghai/Cancun). * simulators/ethereum/engine: Fix Cancun fcUV2 tests bugs --------- Co-authored-by: jangko <jangko128@gmail.com> * clients: only output full genesis file at high log levels (ethereum#927) * clients: Trim genesis output for low log levels. * clients: Specific echo for trimmed genesis output. * clients: remove openethereum as its deprecated (ethereum#932) * simulators/ethereum/engine: update test names for distinction (ethereum#914) * simulators: fix typos in comments (ethereum#933) * simulators/ethereum/engine: Add test to re-org to mempool and back in (ethereum#900) simulators/ethereum/engine: Add re-org to mempool and back intest * simulators/ethereum/engine: Minor fix to re-org tests (ethereum#934) simulators/ethereum/engine: minor fix to re-org tests * clients/besu: remove HIVE_SKIP_POW * clients/erigon: remove HIVE_SKIP_POW * clients/erigon: set terminalTotalDifficultyPassed * clients/ethereumjs: remove mention of HIVE_SKIP_POW * clients/go-ethereum: remove -gcmode=archive in import * clients/nethermind: remove mentions of HIVE_SKIP_POW * clients/nimbus-el: remove mentions of HIVE_SKIP_POW * clients/reth: remove mention of HIVE_SKIP_POW * hivesim: only log test and suite skips at high log levels (ethereum#923) * graphql: add test case for eip-4844 fields (ethereum#894) * cmd/hivechain: add ability to create valid clique chain (ethereum#938) The hivechain tool can now create a signed clique chain. It can be important to have a chain with actually valid block seal in some test scenarios, and go-ethereum can't mine ethash blocks anymore, so clique was the only option. This pulls in a go-ethereum update to get access to an improved GenerateChain implementation. * simulators/ethereum/sync: use engine API to trigger sync (ethereum#922) This updates the ethereum/sync simulator to use a newer post-merge chain. Sync is now triggered via the engine API. * go.mod: upgrade github.com/docker/docker * simulators/devp2p: upgrade hivesim * simulators/smoke: upgrade hivesim * simulators/ethereum/sync: upgrade hivesim * simulators/ethereum/rpc: upgrade hivesim * simulators/ethereum/rpc-compat: upgrade hivesim * simulators/ethereum/pyspec: upgrade hivesim * simulators/ethereum/graphql: upgrade hivesim * simulators/ethereum/engine: upgrade hivesim * simulators/ethereum/consensus: upgrade hivesim * simulators/ethereum: remove go.work Having a Go workspace file ties all the simulators together in terms of their dependency versions. This is a problem when one of them wants to replace a dependency version. When building the simulator, hive will not use the workspace file, so it makes little sense to have it. * simulators/ethereum/pyspec: module replacement to reference engine sim * simulators/ethereum/engine: Fix bugs for ForkID and Missing Ancenstor Tests (ethereum#936) * clients/go-ethereum: use --state.scheme=path * clients: remove unused HIVE_TESTNET variable * docs: remove HIVE_SKIP_POW * cmd/hivechain: disable difficulty-bomb-only forks * cmd/hivechain: remove HIVE_SKIP_POW in forkenv output * clients/ethereumjs: verbose RPC logging (ethereum#939) * clients: add 'glacier' forks in mapper (ethereum#941) * clients/go-ethereum: remove 'yolo' fork blocks * clients/ethereumjs: remove 'yolo' forks in mapper * clients: add missing 'glacier' forks in mapper * cmd/hivechain: put back difficulty-only forks This reverts commit f01b2d3. * simulators/smoke: add 'glacier' forks * cmd/hivechain: improve uncle generation * hive: add --sim.randomseed flag (ethereum#943) * simulators/ethereum/engine: Add randomness seed input (ethereum#944) * simulators/ethereum/engine: randomness seed input * simulators/ethereum/engine: Handle zero HIVE_RANDOM_SEED * clients/besu: Remove trusted setup (ethereum#946) * cmd/hivechain: add 4788 contract to genesis and set beacon root post-cancun Co-authored-by: Felix Lange <fjl@twurst.com> * clients/ethereumjs: add faster local test dockerfile (ethereum#940) * clients/lodestar-vc: add `--builder` flag (ethereum#949) * clients/teku-bn: Add rate limit parameters (ethereum#899) * clients/teku: Add rate limit parameters * clients/teku-bn: Use hive variable for peer scoring parameters * simulators/ethereum/engine,pyspec: Upgrade geth branch (ethereum#951) simulators/ethereum: upgrade geth branch * configs/cancun: Use go-ethereum master (ethereum#952) configs/cancun: use geth master * clients/teku-bn: Remove trusted setup file, add `--ignore-weak-subjectivity-period-enabled` (ethereum#950) * clients/teku-bn: Remove trusted setup file * clients/teku-bn: Add `--ignore-weak-subjectivity-period-enabled` * hivesim: dd documentation generation (ethereum#948) * clients/erigon, simulators/ethereum/rpc: patch RPC tests for erigon (ethereum#953) TTDPassed=true would make Erigon consider it POS chain - not applicable for clique or fakepow-based tests * cmd/hivechain: fix typos in contracts * cmd/hivechain: add snap test contract in genesis * clients/nethermind: upgrade to .NET 8 (ethereum#955) * simulators/devp2p: add support for new eth tests (ethereum#942) Co-authored-by: lightclient <lightclient@protonmail.com> * clients/nethermind: update TxPool config (ethereum#956) Nethermind recently refactored blob pool to support blob transaction reorgs, introducing an additional flag. We decided to consolidate three blob pool-related flags into one enum. This PR enables support for blob transactions + persistent blob storage + blob transactions reorgs. * clients/erigon: small fix to mapper jq (ethereum#962) Fix: true instead of 1 * simulators/ethereum/consensus: Fix `excessBlobGas` genesis (ethereum#964) simulators/ethereum/consensus: Fix excessBlobGas genesis * clients/erigon: Fix git dockerfile (ethereum#965) * clients/besu: Fix git dockerfile (ethereum#966) * all: fix some typos in README.md files (ethereum#968) * cmd/hivechain: improve modifier schedule * cmd/hivechain: add more transaction types * cmd/hivechain: add simple test for generate * cmd/hivechain: deploy revert contract * cmd/hivechain: improve spacing in callrevert * cmd/hivechain: improve deploy tx gaslimit * cmd/hivechain: avoid OOG in randomcode Reduce output size. 256 bytes of code cost ~50k gas. * cmd/hivechain: correct selectors in callrevert * cmd/hivechain: add blob transaction * clients/reth: use ghcr.io/paradigmxyz/reth as base image (ethereum#971) * clients/reth: use ghcr.io/paradigmxyz/reth as base image * clients/reth: use latest tag * cmd/hivechain: use calldata hash as log topic in emit contract * clients/nethermind: Fix Dockerfile.git (ethereum#972) * simulators/ethereum/rpc-compat: load chain env from tests * simulators/ethereum/rpc-compat: add explainer in diff message * clients/nimbus-el: change command line options to use combo HTTP server for RPC (ethereum#973) * .circleci: Add CI for rust simulators (ethereum#980) * .circleci: add support for running ci's based off code modified * .circleci: Add CI for rust simulators * clients: add portal network client definitions (ethereum#977) * .ciricleci: fix circleci script after breaking from ethereum#980 (ethereum#982) * hivesim: add built-in support for connecting to the engine API We need to do that in a lot more tests now and it gets tiring to redeclare the token everywhere. * go.mod: go.mod tidy * simulators/ethereum/rpc-compat: send forkchoiceUpdated to client (ethereum#983) * simulators/ethereum/sync: use EngineAPI method of hivesim * simulators/ethereum/rpc-compat: handle test comments and avoid error message comparison (ethereum#984) * clients/besu: remove --engine-jwt-enabled * clients/reth: fix merge netsplit block in mapper (ethereum#986) * simulators/ethereum/pyspec: Use latest EEST fixture release. (ethereum#985) * simulators/ethereum/pyspec: Update dockerfile tests release structure. * simulators/ethereum/pyspec: Tweak to adhere to fixture format change. * simulators/portal/history/rpc-compat: add portal network history rpc-compat simulator (ethereum#978) * clients: add 'portal' role * simulators/portal/history/portal-interop: add portal network history simulator (ethereum#987) * simulators/portal/history/portal-mesh: add portal network history portal-mesh simulator (ethereum#988) * simulators/portal/history/trin-bridge: add portal network history trin-bridge simulator (ethereum#989) * simulators/portal/beacon/rpc-compat: add portal network beacon rpc-compat simulator (ethereum#990) * clients/prysm-vc: Use REST api (ethereum#906) * simulators/eth2/engine: Fix error checking (ethereum#897) * clients/lodestar-bn: Add optional flag to disable peer scoring (ethereum#911) * clients/erigon: Configure snapshots flag (ethereum#992) clients/erigon/erigon.sh: Configure snapshots flag. * clients/go-ethereum: Remove miner gasprice flag (ethereum#993) clients/go-ethereum/geth.sh: Remove miner gasprice flag. * simulators/ethereum/engine: Fixes for execution-apis#498 (ethereum#974) * simulators/ethereum/engine: Fix expected error on fcu tests * simulators/ethereum/engine: Get Payload delay at spec level * simulators/ethereum/engine: Correct error code on inconsistent FcU * simulators/ethereum/engine: Invaild Payload Attributes Expectation Modification * simulators/portal: refactor simulators to run multiple suites (ethereum#994) This is just to cut down on the number of Rust projects and Dockerfiles. * simulators/ethereum/engine: Expect error code for invalid payload attributes tests (ethereum#996) simulators/ethereum/engine: Expect error code for invalid payload attributes tests. * clients/lighthouse-bn: Add trusted peers env var (ethereum#908) * clients/besu: fix merge block in mapper (ethereum#999) fix fork id problem Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net> * simulators/ethereum/consensus: add Paris as additional merge fork (ethereum#997) * simulators/portal/history: trin_bridge suite remove redundant extra client (ethereum#998) * clients/erigon: Increase blobpool limit in Erigon (ethereum#1000) * simulators/ethereum/pyspec: Refactor, add sync payload verification (ethereum#995) * simulators/ethereum/pyspec: Refactor, add sync payload verification * simulators/ethereum/pyspec: Declare sync timeout constant * simulators/ethereum/pyspec: Disable timing print * simulators/ethereum/consensus: add more 'paris' forks * simulators/portal/history: fix bug where only headers were tested (ethereum#1001) * clients/reth: make sure pruner doesn't start on tests (ethereum#1002) * simulators/eth2: Fix Docker golang version (ethereum#1003) * simulators/eth2/engine: Dockerfile, golang:1.20 * simulators/eth2/testnet: Dockerfile, golang:1.20 * simulators/eth2/withdrawals: Dockerfile, golang:1.20 * clients/portal: update Dockerfiles to use baseimage/tag arg format (ethereum#1005) --------- Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net> Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com> Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net> Co-authored-by: Parithosh Jayanthi <parithosh.jayanthi@ethereum.org> Co-authored-by: Felix Lange <fjl@twurst.com> Co-authored-by: Mario Vega <marioevz@gmail.com> Co-authored-by: Dan Cline <6798349+Rjected@users.noreply.github.com> Co-authored-by: spencer <spencer@spencertaylorbrown.uk> Co-authored-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net> Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com> Co-authored-by: Dan <danceratopz@gmail.com> Co-authored-by: spencer <spencer.taylor-brown@ethereum.org> Co-authored-by: Somnath <snb895@outlook.com> Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com> Co-authored-by: Kim De Mey <kim.demey@gmail.com> Co-authored-by: Delweng <delweng@gmail.com> Co-authored-by: Alexey <me@flcl.me> Co-authored-by: jangko <jangko128@gmail.com> Co-authored-by: vuittont60 <81072379+vuittont60@users.noreply.github.com> Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com> Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com> Co-authored-by: lightclient <lightclient@protonmail.com> Co-authored-by: Marcin Sobczak <77129288+marcindsobczak@users.noreply.github.com> Co-authored-by: Vehorny <153144728+vehorny@users.noreply.github.com> Co-authored-by: Martin HS <martin@swende.se> Co-authored-by: Kolby Moroz Liebl <31669092+KolbyML@users.noreply.github.com> Co-authored-by: Stefan Pingel <16143240+pinges@users.noreply.github.com> Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com>
1 parent e2e6833 commit 47449f6

File tree

264 files changed

+20934
-14823
lines changed

Some content is hidden

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

264 files changed

+20934
-14823
lines changed

.circleci/config.yml

Lines changed: 8 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,14 @@
11
version: 2.1
2-
orbs:
3-
go: circleci/go@1.5.0
4-
5-
jobs:
6-
# This job builds the hive executable and stores it in the workspace.
7-
build:
8-
docker:
9-
- image: cimg/go:1.19
10-
steps:
11-
# Build it.
12-
- checkout
13-
- go/load-cache
14-
- go/mod-download
15-
- go/save-cache
16-
- run: {command: 'go build -ldflags="-extldflags=-static" .'}
17-
# Store the executable.
18-
- persist_to_workspace:
19-
root: .
20-
paths: ["hive"]
212

22-
# This job runs the smoke test simulations. This requires a virtual
23-
# machine instead of the container-based build environment because
24-
# hive needs to be able to talk to the docker containers it creates.
25-
smoke-tests:
26-
machine:
27-
image: ubuntu-2004:202201-02
28-
steps:
29-
- checkout
30-
- attach_workspace: {at: "/tmp/build"}
31-
- run:
32-
command: "/tmp/build/hive --sim=smoke/genesis --client=go-ethereum"
33-
- run:
34-
command: "/tmp/build/hive --sim=smoke/network --client=go-ethereum"
3+
setup: true
354

36-
# This job also runs the smoke test simulations, but against a remote dockerd.
37-
smoke-tests-remote-docker:
38-
docker:
39-
- image: cimg/base:2022.04
40-
steps:
41-
- checkout
42-
- attach_workspace: {at: "/tmp/build"}
43-
- setup_remote_docker: {version: 20.10.14}
44-
- run:
45-
command: "/tmp/build/hive --sim=smoke/genesis --client=go-ethereum --loglevel 5"
46-
- run:
47-
command: "/tmp/build/hive --sim=smoke/network --client=go-ethereum --loglevel 5"
48-
49-
# This job runs the go unit tests.
50-
go-test:
51-
docker:
52-
- image: cimg/go:1.19
53-
steps:
54-
# Get the source.
55-
- checkout
56-
- go/load-cache
57-
- go/mod-download
58-
- go/save-cache
59-
# Run the tests.
60-
- run:
61-
name: "hive module tests"
62-
command: "go test -cover ./..."
63-
- run:
64-
name: "hiveproxy module tests"
65-
command: "go test -cover ./..."
66-
working_directory: "./hiveproxy"
67-
- run:
68-
name: "Compile Go simulators"
69-
command: ".circleci/compile-simulators.sh"
5+
orbs:
6+
path-filtering: circleci/path-filtering@0.0.1
707

718
workflows:
72-
main:
9+
setup-workflow:
7310
jobs:
74-
- go-test
75-
- build
76-
- smoke-tests:
77-
requires: ["build"]
78-
- smoke-tests-remote-docker:
79-
requires: ["build"]
11+
- path-filtering/filter:
12+
mapping: |
13+
simulators/portal/.* rust-ci true
14+
base-revision: origin/master

.circleci/continue_config.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
version: 2.1
2+
orbs:
3+
go: circleci/go@1.5.0
4+
5+
parameters:
6+
rust-ci:
7+
type: boolean
8+
default: false
9+
10+
jobs:
11+
# This job builds the hive executable and stores it in the workspace.
12+
build:
13+
docker:
14+
- image: cimg/go:1.21
15+
steps:
16+
# Build it.
17+
- checkout
18+
- go/load-cache
19+
- go/mod-download
20+
- go/save-cache
21+
- run: {command: 'go build -ldflags="-s -extldflags=-static" -tags "osusergo netgo static_build" .'}
22+
# Store the executable.
23+
- persist_to_workspace:
24+
root: .
25+
paths: ["hive"]
26+
27+
# This job runs the smoke test simulations. This requires a virtual
28+
# machine instead of the container-based build environment because
29+
# hive needs to be able to talk to the docker containers it creates.
30+
smoke-tests:
31+
machine:
32+
image: ubuntu-2004:202201-02
33+
steps:
34+
- checkout
35+
- attach_workspace: {at: "/tmp/build"}
36+
- run:
37+
command: "/tmp/build/hive --sim=smoke/genesis --client=go-ethereum"
38+
- run:
39+
command: "/tmp/build/hive --sim=smoke/network --client=go-ethereum"
40+
41+
# This job also runs the smoke test simulations, but against a remote dockerd.
42+
smoke-tests-remote-docker:
43+
docker:
44+
- image: cimg/base:2022.04
45+
steps:
46+
- checkout
47+
- attach_workspace: {at: "/tmp/build"}
48+
- setup_remote_docker: {version: 20.10.14}
49+
- run:
50+
command: "/tmp/build/hive --sim=smoke/genesis --client=go-ethereum --loglevel 5"
51+
- run:
52+
command: "/tmp/build/hive --sim=smoke/network --client=go-ethereum --loglevel 5"
53+
54+
# This job runs the go unit tests.
55+
go-test:
56+
docker:
57+
- image: cimg/go:1.21
58+
steps:
59+
# Get the source.
60+
- checkout
61+
- go/load-cache
62+
- go/mod-download
63+
- go/save-cache
64+
# Run the tests.
65+
- run:
66+
name: "hive module tests"
67+
command: "go test -cover ./..."
68+
- run:
69+
name: "hiveproxy module tests"
70+
command: "go test -cover ./..."
71+
working_directory: "./hiveproxy"
72+
- run:
73+
name: "Compile Go simulators"
74+
command: ".circleci/compile-simulators.sh"
75+
# this makes sure the rust code is good
76+
rust-simulators:
77+
docker:
78+
- image: cimg/rust:1.75.0
79+
steps:
80+
- checkout
81+
- run:
82+
name: Install rustfmt
83+
command: rustup component add rustfmt
84+
- run:
85+
name: Install Clippy
86+
command: rustup component add clippy
87+
- run:
88+
name: Install Clang
89+
command: sudo apt update && sudo apt-get install clang -y
90+
- run:
91+
name: "Lint, build, test Rust simulators"
92+
command: ".circleci/rust-simulators.sh"
93+
94+
workflows:
95+
main:
96+
jobs:
97+
- go-test
98+
- build
99+
- smoke-tests:
100+
requires: ["build"]
101+
- smoke-tests-remote-docker:
102+
requires: ["build"]
103+
rust-jobs:
104+
when: << pipeline.parameters.rust-ci >>
105+
jobs:
106+
- rust-simulators

.circleci/rust-simulators.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# This causes the bash script to exit immediately if any commands errors out
4+
set -e
5+
6+
failed=""
7+
sims=$(find simulators -name Cargo.toml)
8+
for d in $sims; do
9+
d="$(dirname "$d")"
10+
echo "Lint, build, test $d"
11+
( cd "$d" || exit 1;
12+
cargo fmt --all -- --check;
13+
cargo clippy --all --all-targets --all-features --no-deps -- --deny warnings;
14+
cargo test --workspace -- --nocapture;
15+
)
16+
done

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ workspace
33
.idea/
44
# build output
55
/hive
6+
7+
# build output for rust simulators files
8+
simulators/**/Cargo.lock
9+
simulators/**/target

clients/besu/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ COPY genesis.json /genesis.json
1717
COPY mapper.jq /mapper.jq
1818
COPY besu.sh /opt/besu/bin/besu-hive.sh
1919
COPY enode.sh /hive-bin/enode.sh
20-
COPY trusted_setup.txt /trusted_setup.txt
2120

2221
# Set execute permissions for scripts
2322
RUN chmod +x /opt/besu/bin/besu-hive.sh /hive-bin/enode.sh

clients/besu/Dockerfile.git

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
### Build Besu From Git:
22

33
## Builder stage: Compiles besu from a git repository
4-
FROM openjdk:17-jdk-slim as builder
4+
FROM ubuntu:22.04 as builder
55

66
ARG tag=main
77
ARG github=hyperledger/besu
88

9-
RUN echo "Cloning: $github - $tag" && \
10-
apt-get update && apt-get install -y git libsodium-dev libnss3-dev \
9+
RUN echo "installing java on ubuntu base image" \
10+
&& apt-get update && apt-get install -y git libsodium-dev libnss3-dev \
11+
&& apt-get install --no-install-recommends -q --assume-yes ca-certificates-java=20190909* \
12+
&& apt-get install --no-install-recommends -q --assume-yes openjdk-17-jre-headless=17* libjemalloc-dev=5.* \
13+
&& echo "Cloning: $github - $tag" \
1114
&& git clone --depth 1 --branch $tag https://github.com/$github \
1215
&& cd besu && ./gradlew installDist
1316

1417
## Final stage: Sets up the environment for running besu
15-
FROM openjdk:17-jdk-slim
18+
FROM ubuntu:22.04
1619

1720
# Copy compiled binary from builder
1821
COPY --from=builder /besu/build/install/besu /opt/besu
1922

2023
RUN apt-get update && apt-get install -y curl jq libsodium23 libnss3-dev \
21-
&& apt-get clean && rm -rf /var/lib/apt/lists/*
24+
&& apt-get install --no-install-recommends -q --assume-yes openjdk-17-jre-headless=17* libjemalloc-dev=5.* \
25+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
2226

2327
# Create version.txt
2428
RUN /opt/besu/bin/besu --version > /version.txt
@@ -28,7 +32,6 @@ COPY genesis.json /genesis.json
2832
COPY mapper.jq /mapper.jq
2933
COPY besu.sh /opt/besu/bin/besu-hive.sh
3034
COPY enode.sh /hive-bin/enode.sh
31-
COPY trusted_setup.txt /trusted_setup.txt
3235

3336
# Set execute permissions for scripts
3437
RUN chmod +x /opt/besu/bin/besu-hive.sh /hive-bin/enode.sh

clients/besu/Dockerfile.local

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
### Build Besu Locally:
22

33
## Builder stage: Compiles besu from a local directory
4-
FROM openjdk:17-jdk-slim as builder
4+
FROM ubuntu:22.04 as builder
55

66
# Default local client path: clients/besu/<besu>
77
ARG local_path=besu
88
COPY $local_path besu
99

1010
RUN apt-get update && apt-get install -y git libsodium-dev libnss3-dev \
11+
&& apt-get install --no-install-recommends -q --assume-yes ca-certificates-java=20190909 \
12+
&& apt-get install --no-install-recommends -q --assume-yes openjdk-17-jre-headless=17* libjemalloc-dev=5.* \
1113
&& cd besu && ./gradlew installDist
1214

1315
## Final stage: Sets up the environment for running besu
14-
FROM openjdk:17-jdk-slim
16+
FROM ubuntu:22.04
1517

1618
# Copy compiled binary from builder
1719
COPY --from=builder /besu/build/install/besu /opt/besu
1820

1921
RUN apt-get update && apt-get install -y curl jq libsodium23 libnss3-dev \
22+
&& apt-get install --no-install-recommends -q --assume-yes ca-certificates-java=20190909 \
23+
&& apt-get install --no-install-recommends -q --assume-yes openjdk-17-jre-headless=17* libjemalloc-dev=5.* \
2024
&& apt-get clean && rm -rf /var/lib/apt/lists/*
2125

2226
# Create version.txt
@@ -27,7 +31,6 @@ COPY genesis.json /genesis.json
2731
COPY mapper.jq /mapper.jq
2832
COPY besu.sh /opt/besu/bin/besu-hive.sh
2933
COPY enode.sh /hive-bin/enode.sh
30-
COPY trusted_setup.txt /trusted_setup.txt
3134

3235
# Set execute permissions for scripts
3336
RUN chmod +x /opt/besu/bin/besu-hive.sh /hive-bin/enode.sh

clients/besu/besu.sh

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,11 @@
3535
#
3636
# - HIVE_MINER enables mining. value is coinbase.
3737
# - HIVE_MINER_EXTRA extra-data field to set for newly minted blocks
38-
# - HIVE_SKIP_POW If set, skip PoW verification
3938
# - HIVE_LOGLEVEL Client log level
4039
# - HIVE_GRAPHQL_ENABLED If set, GraphQL is enabled on port 8545 and RPC is disabled
4140
#
4241
# These flags are not supported by the Besu hive client
4342
#
44-
# - HIVE_TESTNET whether testnet nonces (2^20) are needed
4543
# - HIVE_FORK_DAO_VOTE whether the node support (or opposes) the DAO fork
4644

4745
set -e
@@ -63,9 +61,19 @@ esac
6361
FLAGS="--logging=$LOG --data-storage-format=BONSAI"
6462

6563
# Configure the chain.
66-
jq -f /mapper.jq /genesis.json > /besugenesis.json
67-
echo -n "Genesis: "; cat /besugenesis.json
68-
FLAGS="$FLAGS --genesis-file=/besugenesis.json "
64+
mv /genesis.json /genesis-input.json
65+
jq -f /mapper.jq /genesis-input.json > /genesis.json
66+
FLAGS="$FLAGS --genesis-file=/genesis.json "
67+
68+
# Dump genesis.
69+
if [ "$HIVE_LOGLEVEL" -lt 4 ]; then
70+
echo "Supplied genesis state (trimmed, use --sim.loglevel 4 or 5 for full output):"
71+
jq 'del(.alloc[] | select(.balance == "0x123450000000000000000"))' /genesis.json
72+
else
73+
echo "Supplied genesis state:"
74+
cat /genesis.json
75+
fi
76+
6977

7078
# Enable experimental 'berlin' hard-fork features if configured.
7179
#if [ -n "$HIVE_FORK_BERLIN" ]; then
@@ -75,10 +83,8 @@ FLAGS="$FLAGS --genesis-file=/besugenesis.json "
7583
# The client should start after loading the blocks, this option configures it.
7684
IMPORTFLAGS="--run"
7785

78-
# Disable PoW check if requested.
79-
if [ -n "$HIVE_SKIP_POW" ]; then
80-
IMPORTFLAGS="$IMPORTFLAGS --skip-pow-validation-enabled"
81-
fi
86+
# Skip PoW checks on import.
87+
IMPORTFLAGS="$IMPORTFLAGS --skip-pow-validation-enabled"
8288

8389
# Load chain.rlp if present.
8490
if [ -f /chain.rlp ]; then
@@ -113,7 +119,7 @@ fi
113119
if [ "$HIVE_MINER_EXTRA" != "" ]; then
114120
FLAGS="$FLAGS --miner-extra-data=$HIVE_MINER_EXTRA"
115121
fi
116-
FLAGS="$FLAGS --min-gas-price=1 --tx-pool-price-bump=0 --tx-pool-limit-by-account-percentage=1"
122+
FLAGS="$FLAGS --min-gas-price=1 --tx-pool-price-bump=0"
117123

118124
# Configure peer-to-peer networking.
119125
if [ "$HIVE_BOOTNODE" != "" ]; then
@@ -150,12 +156,7 @@ RPCFLAGS="$RPCFLAGS --rpc-ws-enabled --rpc-ws-api=DEBUG,ETH,NET,WEB3,ADMIN --rpc
150156
# Enable merge support if needed
151157
if [ "$HIVE_TERMINAL_TOTAL_DIFFICULTY" != "" ]; then
152158
echo "0x7365637265747365637265747365637265747365637265747365637265747365" > /jwtsecret
153-
RPCFLAGS="$RPCFLAGS --engine-host-allowlist=* --engine-jwt-enabled --engine-jwt-secret /jwtsecret"
154-
fi
155-
156-
# Enable KZG trusted setup if cancun timestamp is set, needed for custom genesis on Besu wtih Cancun
157-
if [ "$HIVE_CANCUN_TIMESTAMP" != "" ]; then
158-
FLAGS="$FLAGS --kzg-trusted-setup=/trusted_setup.txt"
159+
RPCFLAGS="$RPCFLAGS --engine-host-allowlist=* --engine-jwt-secret /jwtsecret"
159160
fi
160161

161162
# Start Besu.

clients/besu/mapper.jq

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ def to_int:
4343
"muirGlacierBlock": env.HIVE_FORK_MUIR_GLACIER|to_int,
4444
"berlinBlock": env.HIVE_FORK_BERLIN|to_int,
4545
"londonBlock": env.HIVE_FORK_LONDON|to_int,
46-
"parisBlock": env.HIVE_MERGE_BLOCK_ID|to_int,
46+
"arrowGlacierBlock": env.HIVE_FORK_ARROW_GLACIER|to_int,
47+
"grayGlacierBlock": env.HIVE_FORK_GRAY_GLACIER|to_int,
48+
"mergeNetsplitBlock": env.HIVE_MERGE_BLOCK_ID|to_int,
4749
"terminalTotalDifficulty": env.HIVE_TERMINAL_TOTAL_DIFFICULTY|to_int,
4850
"shanghaiTime": env.HIVE_SHANGHAI_TIMESTAMP|to_int,
4951
"cancunTime": env.HIVE_CANCUN_TIMESTAMP|to_int,

0 commit comments

Comments
 (0)