Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
d99a265
hive: add optimism devnet simulator (#1)
tuxcanfly Apr 28, 2022
c690e2d
simulator (optimism): fix l1 genesis timestamp (#3)
tuxcanfly May 2, 2022
02a7c30
simulator (optimism): rm unnecessary sleep (#2)
tuxcanfly May 2, 2022
8b0eaa2
simulator (op): add l2 genesis predeploy, restore all rpc tests (#5)
tuxcanfly May 11, 2022
e8f075f
simulators (op): refactor - add bss client (#6)
tuxcanfly May 17, 2022
618d9d9
simulators (op): bump semaphore count
tuxcanfly May 18, 2022
d7d68ff
simulator (op): bump semaphore count
tuxcanfly May 19, 2022
28a2629
simulators (op): l2 predeploy - new contracts
tuxcanfly May 19, 2022
dfead8d
simulators (op): bump reference-optimistic-geth
tuxcanfly May 24, 2022
004ddaf
simulators (op): bump go.sum
tuxcanfly May 24, 2022
e4a8971
clients (op): optimistic-specs -> monorepo
tuxcanfly Jun 1, 2022
c1075ce
op: update devnet; sync with monorepo
tuxcanfly Jun 21, 2022
369e447
op: update to use proxy
tuxcanfly Jun 29, 2022
4033d19
op: devnet -> rpc
tuxcanfly Jun 30, 2022
b44fc61
clients (op): fix deploy - use proxy contracts
tuxcanfly Jun 30, 2022
36002ae
op: update circle config for op-tests
tuxcanfly Jun 30, 2022
d46989d
ci: add slack alerts
tuxcanfly Jul 1, 2022
b0861b2
client (op-node): update flags
tuxcanfly Jul 1, 2022
fe26c14
client (op-l1): use monorepo, fix missing npx
tuxcanfly Jul 1, 2022
2c3b871
simulator (op/rpc): bump reference-optimistic-geth
tuxcanfly Jul 6, 2022
be32655
client (op-batcher): rm --sequencer-genesis-hash
tuxcanfly Jul 4, 2022
2b9f1a2
op-batcher: fix flags; update l2geth
tuxcanfly Jul 18, 2022
aef8cb8
simulators/optimism/rpc: update dependencies
protolambda Jul 14, 2022
15a934e
op: refactor op-node to use dynamic hive.Params
tuxcanfly Jul 20, 2022
3f50d83
client(op-node): rm hardcoded ip addrs, ports
tuxcanfly Jul 20, 2022
1dcd5d3
op: rm hardcoded IPs
tuxcanfly Jul 21, 2022
b50390c
pkg: optimism devnet
tuxcanfly Jul 22, 2022
d4b5139
branch docker arg support
protolambda Jul 14, 2022
deef12d
clients: move ARG after FROM
tuxcanfly Jul 25, 2022
6e1e308
simulator (optimism/p2p): add new simulator to test p2p (#15)
tuxcanfly Jul 25, 2022
0dd9a64
simulators/optimism: clean up mod dependencies
protolambda Jul 27, 2022
aa9f95b
simulators/optimism: update hive dependency
protolambda Jul 27, 2022
41e41f7
optimism: fix forge issue, detect setup errors
protolambda Jul 27, 2022
9f8e379
optimism: minimal client definitions, refactor setup for use of flags…
protolambda Jul 28, 2022
20f7dd7
optimism: update optimism mod deps
protolambda Aug 1, 2022
c1168ce
optimism: hardhat deploy config
protolambda Aug 1, 2022
656d759
internal: support build context changes in simulators
protolambda Aug 1, 2022
da8bd89
optimism: rename op l2 client, configure l1 client
protolambda Aug 1, 2022
e8a4ecc
simulators/optimism: testnet sim, update p2p sim
protolambda Aug 1, 2022
93e6acf
optimism: update op-contracts/hardhat testnet setup
protolambda Aug 8, 2022
a83eeff
optimism: testnet fixes
protolambda Aug 8, 2022
d657c7d
optimism: fix client definitions, update dependencies
protolambda Aug 9, 2022
0fc0cda
optimism: add l1 genesis timestamp flag
protolambda Aug 11, 2022
8aae298
optimism: dependency updates
protolambda Aug 11, 2022
3d332f8
optimism: use optimism module by commit
protolambda Aug 11, 2022
394e621
optimism: update testnet sim
protolambda Aug 11, 2022
ff0043d
optimism: update CI, update docs
protolambda Aug 11, 2022
b67e6a5
go.work: add hive proxy module
protolambda Aug 11, 2022
5615e87
circleci: build docker images once, save for other jobs
protolambda Aug 11, 2022
cafb871
go.work: add all simulators
protolambda Aug 11, 2022
1cb0d11
ci: do not compile upstream hive simulators
protolambda Aug 11, 2022
08ef04b
ci: fix client names iteration
protolambda Aug 11, 2022
e7958b0
ci: update to one hive tests job to reduce build work
protolambda Aug 11, 2022
1f265b0
go.work.sum: fix
protolambda Aug 12, 2022
cfb1345
optimism/rpc: update ports
protolambda Aug 12, 2022
55d765e
optimism/rpc: fix genesis config
protolambda Aug 12, 2022
4f2d8e8
ci: Use image builds (#31)
mslipper Aug 17, 2022
0f1d0c1
Cleanups + deposit tests (#33)
mslipper Aug 21, 2022
06f1f16
Archive workspace even on error (#35)
mslipper Aug 22, 2022
674808c
Add withdrawal tests (#36)
mslipper Aug 27, 2022
ba5171c
Remove useless file
mslipper Aug 27, 2022
0633b1a
Embed L1 contracts in genesis (#37)
mslipper Sep 8, 2022
64e4fc9
op deps update (#39)
protolambda Sep 10, 2022
b75b989
Add P2P sync tests (#38)
mslipper Sep 10, 2022
3bf543a
optimism: remove etherbase from op-geth args (#41)
protolambda Sep 24, 2022
6a3a0b0
optimism: use engine api endpoint, not regular endpoint (#40)
protolambda Sep 25, 2022
8c9430c
Upgrade dependencies, add dep upgrade script (#43)
mslipper Sep 26, 2022
e33e80d
Use sequencer key environment variable (#44)
mslipper Sep 26, 2022
d263e17
Hive: deploy contract via deposit (#45)
mslipper Sep 27, 2022
56fa2d6
Improve withdrawal reliability (#46)
mslipper Sep 27, 2022
836abcc
Attempt to fix deposit/withdrawal tests (#48)
mslipper Sep 28, 2022
8cbb5d7
Add simple ERC20 bindings (#49)
mslipper Sep 29, 2022
60183ad
Add roundtrip ERC-20 test through the bridge (#50)
mslipper Sep 30, 2022
929c55f
Add failing deposit with mint tests (#51)
mslipper Sep 30, 2022
075c8d4
Add test for spending more gas on L2 than allotted on L1 (#52)
mslipper Sep 30, 2022
3f7962f
Tx Forwarding test (#54)
trianglesphere Oct 7, 2022
828b193
clients/prysm-bn: Add enable-debug-rpc-endpoints (#651)
marioevz Sep 9, 2022
7a2778c
simulator/ethereum/engine: Fix Transaction Already Known Issue (#634)
marioevz Sep 23, 2022
3a80ce8
Remove `op-contracts` client from readmes (#53)
trianglesphere Oct 7, 2022
72a0888
Merge pull request #55 from ethereum-optimism/jg/sync_fork
mslipper Oct 7, 2022
45134ff
Fix gas fees of transactions
trianglesphere Oct 19, 2022
e1a6ffb
Merge pull request #56 from ethereum-optimism/jg/fix_p2p_test
trianglesphere Oct 19, 2022
dbdb4ad
Add ALLOW_NON_FINALIZED to support new proposer
mslipper Nov 2, 2022
566c01f
go mod tidy
mslipper Nov 2, 2022
31aa644
update dependencies, remove outdated testnet simulator (#57)
mslipper Nov 4, 2022
927ff05
optimism: update setup and simulators to monorepo v0.10 releases
protolambda Nov 8, 2022
197ebe0
optimism: import optimism module by git commit
protolambda Nov 8, 2022
ba9a92c
bump seq drift
mslipper Nov 8, 2022
0786a2d
Merge pull request #58 from ethereum-optimism/update-to-v0_10
mslipper Nov 8, 2022
61035c5
hive: fix config for L2 genesis creation (#60)
tynes Nov 8, 2022
ba6cbca
Remove `require` from non main go-routine (#61)
trianglesphere Nov 8, 2022
b560cd1
hive: add SystemConfig bindings (#59)
tynes Nov 8, 2022
fc77936
Logging
trianglesphere Nov 8, 2022
e39047c
Clean up p2p test
trianglesphere Nov 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 65 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
version: 2.1
orbs:
go: circleci/[email protected]
slack: circleci/[email protected]

jobs:
# This job builds the hive executable and stores it in the workspace.
build:
docker:
- image: cimg/go:1.17
- image: cimg/go:1.19
steps:
# Build it.
- checkout
Expand All @@ -19,37 +20,50 @@ jobs:
root: .
paths: ["hive"]

# This job runs the smoke test simulations. This requires a virtual
# machine instead of the container-based build environment because
# hive needs to be able to talk to the docker containers it creates.
smoke-tests:
# The below job runs the optimism test simulations. This requires a virtual
# machine instead of the container-based build environment because hive needs
# to be able to talk to the docker containers it creates.
run-hive-sim:
machine:
image: ubuntu-2004:202201-02
image: ubuntu-2204:2022.07.1
docker_layer_caching: true
parameters:
sim:
type: string
default: optimism
description: Sims to run
steps:
- checkout
- attach_workspace: {at: "/tmp/build"}
- run:
command: "/tmp/build/hive --sim=smoke/genesis --client=go-ethereum"
command: |
/tmp/build/hive \
-sim=<<parameters.sim>> \
-sim.loglevel=5 \
-docker.pull=true \
-client=go-ethereum,op-geth_optimism-history,op-proposer_develop,op-batcher_develop,op-node_develop |& tee /tmp/build/hive.log || echo "failed."
- run:
command: "/tmp/build/hive --sim=smoke/network --client=go-ethereum"

# This job also runs the smoke test simulations, but against a remote dockerd.
smoke-tests-remote-docker:
docker:
- image: cimg/base:2022.04
steps:
- checkout
- attach_workspace: {at: "/tmp/build"}
- setup_remote_docker: {version: 20.10.14}
command: |
tar -cvf /tmp/workspace.tgz -C /home/circleci/project /home/circleci/project/workspace
name: "Archive workspace"
- store_artifacts:
path: /tmp/workspace.tgz
destination: hive-workspace.tgz
- run:
command: "/tmp/build/hive --sim=smoke/genesis --client=go-ethereum --loglevel 5"
- run:
command: "/tmp/build/hive --sim=smoke/network --client=go-ethereum --loglevel 5"
command: "! grep 'pass.*=false' /tmp/build/hive.log"
- slack/notify:
channel: C03N11M0BBN
event: fail
template: basic_fail_1
- slack/notify:
channel: C03N11M0BBN
event: pass
template: basic_success_1

# This job runs the go unit tests.
go-test:
docker:
- image: cimg/go:1.17
- image: cimg/go:1.19
steps:
# Get the source.
- checkout
Expand All @@ -64,16 +78,41 @@ jobs:
name: "hiveproxy module tests"
command: "go test -cover ./..."
working_directory: "./hiveproxy"
- run:
name: "Compile Go simulators"
command: ".circleci/compile-simulators.sh"
# some upstream simulators are broken, don't use latest, geth, etc.
# - run:
# name: "Compile Go simulators"
# command: ".circleci/compile-simulators.sh"

workflows:
main:
jobs:
- go-test
- build
- smoke-tests:
- run-hive-sim:
name: hive-test-l1ops
requires: ["build"]
- smoke-tests-remote-docker:
context: slack
sim: optimism/l1ops
- run-hive-sim:
name: hive-test-p2p
requires: [ "build" ]
context: slack
sim: optimism/p2p
- run-hive-sim:
name: hive-test-rpc
requires: [ "build" ]
context: slack
sim: optimism/rpc
scheduled:
triggers:
- schedule:
# run every 4 hours
cron: "0 0,4,8,12,16 * * *"
filters:
branches:
only: [ "optimism" ]
jobs:
- build
- run-hive-sim:
requires: ["build"]
context: slack
6 changes: 3 additions & 3 deletions .circleci/upgrade-hivesim.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

version=latest
version=optimism
if [ -n "$1" ]; then
version="$1"
fi
Expand All @@ -12,7 +12,7 @@ for d in $sims; do
(
set -e
cd $d
go get -d "github.com/ethereum/hive@$version"
go mod tidy -compat=1.17
go get -d "github.com/ethereum-optimism/hive@$version"
go mod tidy
)
done
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
hive:
go build -o ./hive ./hive.go
.PHONY: hive

mod-tidy:
cd simulators/optimism/l1ops && go mod tidy && cd .. && \
cd p2p && go mod tidy && cd .. && \
cd rpc && go mod tidy && \
cd ../../../ && go mod tidy
.PHONY: mod-tidy

contracts:
cd contracts && \
solc --bin --abi --overwrite -o . ./SimpleERC20.sol && \
solc --bin --abi --overwrite -o . ./Failure.sol
.PHONY: contracts

bindings: contracts
abigen \
--abi ./contracts/SimpleERC20.abi \
--bin ./contracts/SimpleERC20.bin \
--pkg bindings \
--type "SimpleERC20" \
--out ./optimism/bindings/simple_erc20.go
abigen \
--abi ./contracts/Failure.abi \
--bin ./contracts/Failure.bin \
--pkg bindings \
--type "Failure" \
--out ./optimism/bindings/failure.go
.PHONY: bindings
4 changes: 2 additions & 2 deletions clients/go-ethereum/geth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ mv /genesis.json /genesis-input.json
jq -f /mapper.jq /genesis-input.json > /genesis.json

# Dump genesis
echo "Supplied genesis state:"
cat /genesis.json
#echo "Supplied genesis state:"
#cat /genesis.json

# Initialize the local testchain with the genesis state
echo "Initializing database with genesis state..."
Expand Down
11 changes: 11 additions & 0 deletions clients/op-batcher/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG branch=develop
FROM us-central1-docker.pkg.dev/bedrock-goerli-development/images/op-batcher:$branch

RUN apk add bash

COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

RUN op-batcher --version 2>/dev/null | head -1 > /version.txt

ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
13 changes: 13 additions & 0 deletions clients/op-batcher/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Hive requires us to prefix env vars with "HIVE_"
# Iterate the env, find all HIVE_UNPACK_ vars, and remove the HIVE_UNPACK_ prefix.
while IFS='=' read -r -d '' n v; do
if [[ "$n" == HIVE_UNPACK_* ]]; then
name=${n#"HIVE_UNPACK_"} # remove the HIVE_UNPACK_ prefix
echo "$name=$v"
declare -gx "$name=$v"
fi
done < <(env -0)

exec op-batcher
2 changes: 2 additions & 0 deletions clients/op-batcher/hive.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
roles:
- "op-batcher"
11 changes: 11 additions & 0 deletions clients/op-geth/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG branch=optimism-history
FROM ethereumoptimism/op-geth:$branch

RUN apk add curl jq bash
RUN apk add --no-cache ca-certificates
RUN geth console --exec 'console.log(admin.nodeInfo.name)' --maxpeers=0 --nodiscover --dev 2>/dev/null | head -1 > /version.txt

ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
66 changes: 66 additions & 0 deletions clients/op-geth/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/sh
set -exu

# note: geth wants an integer log level (see L1 hive definition)
VERBOSITY=${HIVE_ETH1_LOGLEVEL:-3}

GETH_DATA_DIR=/db
GETH_CHAINDATA_DIR="$GETH_DATA_DIR/geth/chaindata"

CHAIN_ID=$(cat /genesis.json | jq -r .config.chainId)

if [ ! -d "$GETH_CHAINDATA_DIR" ]; then
echo "$GETH_CHAINDATA_DIR missing, running init"
echo "Initializing genesis."
geth --verbosity="$VERBOSITY" init \
--datadir="$GETH_DATA_DIR" \
"/genesis.json"
else
echo "$GETH_CHAINDATA_DIR exists."
fi

# We must set miner.gaslimit to the gas limit in genesis
# in the command below!
GAS_LIMIT_HEX=$(jq -r .gasLimit < /genesis.json | sed s/0x//i | tr '[:lower:]' '[:upper:]')
GAS_LIMIT=$(echo "obase=10; ibase=16; $GAS_LIMIT_HEX" | bc)


EXTRA_FLAGS="--rollup.disabletxpoolgossip=true"

# We check for env variables that may not be bound so we need to disable `set -u` for this section.
set +u
if [ "$HIVE_OP_GETH_SEQUENCER_HTTP" != "" ]; then
EXTRA_FLAGS="$EXTRA_FLAGS --rollup.sequencerhttp $HIVE_OP_GETH_SEQUENCER_HTTP"
fi
set -u

# Warning: Archive mode is required, otherwise old trie nodes will be
# pruned within minutes of starting the devnet.

geth \
--datadir="$GETH_DATA_DIR" \
--verbosity="$VERBOSITY" \
--http \
--http.corsdomain="*" \
--http.vhosts="*" \
--http.addr=0.0.0.0 \
--http.port=8545 \
--http.api=web3,debug,eth,txpool,net,engine \
--ws \
--ws.addr=0.0.0.0 \
--ws.port=8546 \
--ws.origins="*" \
--ws.api=debug,eth,txpool,net,engine \
--authrpc.jwtsecret="/hive/input/jwt-secret.txt" \
--authrpc.port=8551 \
--authrpc.addr=0.0.0.0 \
--syncmode=full \
--nodiscover \
--maxpeers=0 \
--miner.gaslimit=$GAS_LIMIT \
--networkid="$CHAIN_ID" \
--password="$GETH_DATA_DIR"/password \
--allow-insecure-unlock \
--gcmode=archive \
$EXTRA_FLAGS \
"$@"
2 changes: 2 additions & 0 deletions clients/op-geth/hive.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
roles:
- "op-l2"
11 changes: 11 additions & 0 deletions clients/op-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG branch=develop
FROM us-central1-docker.pkg.dev/bedrock-goerli-development/images/op-node:$branch

RUN apk add bash

COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

RUN op-node --version 2>/dev/null | head -1 > /version.txt

ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
15 changes: 15 additions & 0 deletions clients/op-node/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Hive requires us to prefix env vars with "HIVE_"
# Iterate the env, find all HIVE_UNPACK_ vars, and remove the HIVE_UNPACK_ prefix.
while IFS='=' read -r -d '' n v; do
if [[ "$n" == HIVE_UNPACK_* ]]; then
name=${n#"HIVE_UNPACK_"} # remove the HIVE_UNPACK_ prefix
echo "$name=$v"
declare -gx "$name=$v"
fi
done < <(env -0)

op-node


2 changes: 2 additions & 0 deletions clients/op-node/hive.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
roles:
- "op-node"
11 changes: 11 additions & 0 deletions clients/op-proposer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG branch=develop
FROM us-central1-docker.pkg.dev/bedrock-goerli-development/images/op-proposer:$branch

RUN apk add bash

COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

RUN op-proposer --version 2>/dev/null | head -1 > /version.txt

ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
13 changes: 13 additions & 0 deletions clients/op-proposer/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Hive requires us to prefix env vars with "HIVE_"
# Iterate the env, find all HIVE_UNPACK_ vars, and remove the HIVE_UNPACK_ prefix.
while IFS='=' read -r -d '' n v; do
if [[ "$n" == HIVE_UNPACK_* ]]; then
name=${n#"HIVE_UNPACK_"} # remove the HIVE_UNPACK_ prefix
echo "$name=$v"
declare -gx "$name=$v"
fi
done < <(env -0)

exec op-proposer
2 changes: 2 additions & 0 deletions clients/op-proposer/hive.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
roles:
- "op-proposer"
1 change: 1 addition & 0 deletions clients/prysm-bn/prysm_bn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ echo Starting Prysm Beacon Node
--jwt-secret=/jwtsecret \
--min-sync-peers=1 \
--subscribe-all-subnets=true \
--enable-debug-rpc-endpoints=true \
$metrics_option \
--deposit-contract="${HIVE_ETH2_CONFIG_DEPOSIT_CONTRACT_ADDRESS:-0x1111111111111111111111111111111111111111}" \
--contract-deployment-block="${HIVE_ETH2_DEPOSIT_DEPLOY_BLOCK_NUMBER:-0}" \
Expand Down
2 changes: 1 addition & 1 deletion cmd/hivechain/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (cfg generatorConfig) generateAndSave(path string, blockModifier func(i int
}

// Import the chain. This runs all block validation rules.
blockchain, err := core.NewBlockChain(db, nil, config, engine, vm.Config{}, nil, nil)
blockchain, err := core.NewBlockChain(db, nil, &cfg.genesis, nil, engine, vm.Config{}, nil, nil)
if err != nil {
return fmt.Errorf("can't create blockchain: %v", err)
}
Expand Down
Loading