Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arbitrum Stylus #2242

Merged
merged 1,310 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
1310 commits
Select commit Hold shift + click to select a range
0605998
Drop commented out fn
anodar Feb 2, 2024
4dea838
stylus api: separate encoding/decoding from logic
tsahee Feb 3, 2024
6bba0cb
switchthreads takes recovery offset
tsahee Feb 3, 2024
891fbea
programs/api.go: remove unnecessary diffs
tsahee Feb 3, 2024
f2f950c
Merge branch 'go_wasi' into multiple_stacks
tsahee Feb 3, 2024
50cdb4d
limit bold steps
rachel-bousfield Feb 3, 2024
df51fa1
update module roots
rachel-bousfield Feb 3, 2024
8ab3822
Merge pull request #203 from OffchainLabs/limit-bold-steps
rachel-bousfield Feb 3, 2024
1a4dcc1
Merge remote-tracking branch 'origin/stylus' into go_wasi
tsahee Feb 5, 2024
5f6a3a1
go-wasi: fix accountCode{,Size}
tsahee Feb 5, 2024
2bb5465
stylus: fix accountCode
tsahee Feb 5, 2024
7730865
machine: fix multistack hashing
tsahee Feb 6, 2024
933046e
Merge branch 'go_wasi' into multiple_stacks
tsahee Feb 6, 2024
0c1dba0
prover: use main_thread_recovery pc
tsahee Feb 7, 2024
84c5def
arbitrator: cargo fmt
tsahee Feb 7, 2024
893a754
contract: support cothreads
tsahee Feb 7, 2024
5ef8ae7
arbitrator: rust and naming improvements
tsahee Feb 7, 2024
2699efc
go_wasi: no extra copy for large data
tsahee Feb 12, 2024
ef42f44
fix test support for no_copy
tsahee Feb 12, 2024
f666f3b
stub-out ipfs support
tsahee Feb 13, 2024
45e602b
programs/api: remove inefectual code
tsahee Feb 13, 2024
f5df5cc
ipfs: remove unnecessary changes when stubbing
tsahee Feb 13, 2024
2b8d498
update ci to go 1.21
tsahee Feb 13, 2024
7a40448
use constant instead of magic number for evm_api_offset
tsahee Feb 13, 2024
bfed019
test constants are identical in rust and go
tsahee Feb 13, 2024
d55cf6d
remove js-runtime from ci test
tsahee Feb 13, 2024
8505d10
fix dockerfile
tsahee Feb 13, 2024
2cd2b08
multistack: remaining uses standard stack_hashing
tsahee Feb 14, 2024
bbb054f
contracts: fix multistack
tsahee Feb 14, 2024
fb454ae
cargo fmt
tsahee Feb 14, 2024
ea1a0df
fix dockerfile
tsahee Feb 14, 2024
f294392
update contracts
tsahee Feb 14, 2024
84211c1
Merge branch 'go_wasi' into go_wasi_nocopy
tsahee Feb 14, 2024
56c160c
small rust fixes
tsahee Feb 16, 2024
2401a92
result/raw_data rename and sort out
tsahee Feb 16, 2024
4f054ab
comments and names
tsahee Feb 17, 2024
4e935d1
use GoSliceData instead of GoPinnedData
tsahee Feb 17, 2024
6ea1c61
split GoSliceData from SendGoSliceData
tsahee Feb 22, 2024
de6c7ef
disable gosec errors for servers
tsahee Feb 22, 2024
835704b
Revert "disable gosec errors for servers"
tsahee Feb 22, 2024
cc00790
attempt to fix nosec lint
tsahee Feb 22, 2024
f22a426
lint: fix nosec comment
tsahee Feb 22, 2024
1437ff3
initial joint wasip1 implementation
tsahee Feb 23, 2024
54c84d0
caller_env cosmetics
tsahee Feb 28, 2024
1fb2d69
callerenv: move static implementation
tsahee Feb 28, 2024
50670be
split caller env to mem and exec
tsahee Feb 29, 2024
dc85d03
remove unused code
tsahee Feb 29, 2024
0c65c7f
callerenv bugfixes
tsahee Mar 4, 2024
b9aa447
replace arbutil::wavm with static_env
tsahee Mar 4, 2024
cd906c1
caller_env: use read_fixed
tsahee Mar 4, 2024
c3a6027
converge Uptr
tsahee Mar 5, 2024
77eb073
converge more on Uptr
tsahee Mar 5, 2024
a186fc3
fix dockerfile
tsahee Mar 5, 2024
5170ae3
GuestPtr, speed up read/write, docstrings, debug prints, wrap macro, …
rachel-bousfield Mar 8, 2024
7d60088
fix set_len order
rachel-bousfield Mar 8, 2024
d76b355
fixed, simplifications, and MiniAlloc
rachel-bousfield Mar 8, 2024
efc02e0
safer message & response parsing
rachel-bousfield Mar 8, 2024
a4adb63
more cleanup
rachel-bousfield Mar 8, 2024
09f7e35
repin contracts
rachel-bousfield Mar 8, 2024
c61efc5
fix docker
rachel-bousfield Mar 8, 2024
e99b3ff
revert back to WeeAlloc
rachel-bousfield Mar 8, 2024
8ec6f21
fix refs & debug printing
rachel-bousfield Mar 8, 2024
546a471
remove print_string from ExecEnv
tsahee Mar 8, 2024
d18bec5
fix wasip1_stub warnings
tsahee Mar 8, 2024
fff7887
don't recover from error if over max steps
tsahee Mar 8, 2024
c3f5aea
fix loop & print out of steps
rachel-bousfield Mar 8, 2024
33789de
pass time each poll_oneoff
rachel-bousfield Mar 8, 2024
b69e276
address review comments: cleanup
rachel-bousfield Mar 8, 2024
134b103
reintroduce execEnv print_string
tsahee Mar 8, 2024
8cfb8c4
cleanup & remove guestptr DerefMut
rachel-bousfield Mar 8, 2024
69ae4b7
Merge pull request #206 from OffchainLabs/go-wasi-edits
tsahee Mar 8, 2024
9f0ab7e
Merge pull request #204 from OffchainLabs/go_wasi_nocopy
rachel-bousfield Mar 8, 2024
a981045
Merge branch 'stylus' into go_wasi_code_reuse
rachel-bousfield Mar 8, 2024
4d47f3c
Merge pull request #205 from OffchainLabs/go_wasi_code_reuse
rachel-bousfield Mar 8, 2024
5dd3050
add early exit hostio
rachel-bousfield Mar 11, 2024
d41a29f
cleanup
rachel-bousfield Mar 11, 2024
f24764c
fix test env
rachel-bousfield Mar 11, 2024
219d418
cleanup
rachel-bousfield Mar 11, 2024
77c47b2
rename exited_early
rachel-bousfield Mar 11, 2024
1184535
fix typo
rachel-bousfield Mar 12, 2024
484efac
Merge pull request #208 from OffchainLabs/stylus-early-exit
rachel-bousfield Mar 12, 2024
0511504
Merge tag 'v2.2.5' into HEAD
tsahee Mar 12, 2024
846ecf7
prover: limit kzg to native
tsahee Mar 12, 2024
698b076
VM storage cache
rachel-bousfield Mar 13, 2024
cc2728f
cleanup
rachel-bousfield Mar 13, 2024
39d2b22
ipfs: rename files so compiler will ignore them, fix go.mod/sum
tsahee Mar 13, 2024
bd65bdc
fix merge errors
tsahee Mar 13, 2024
09d7c5f
programs: fix calls to WasmAccountTouchCost
tsahee Mar 14, 2024
50ff20c
precompile: limit programs to latest sytlus
tsahee Mar 14, 2024
63cf663
program_test: use systest builder
tsahee Mar 14, 2024
4747bf8
update geth
tsahee Mar 14, 2024
704ce1b
SDK support
rachel-bousfield Mar 14, 2024
a2d98c2
repin rust
rachel-bousfield Mar 14, 2024
35aeb17
cleanup
rachel-bousfield Mar 14, 2024
ffe5dc9
add rust-src
tsahee Mar 14, 2024
1f48bc0
Merge commit '484efac4' into nitro-2.2.5-merge
tsahee Mar 14, 2024
5d2656a
system_test: fix testEarlyExit
tsahee Mar 14, 2024
b51bf56
cargo fmt
tsahee Mar 14, 2024
670e1c2
cargo update
tsahee Mar 15, 2024
c6e264b
program_test: split race from norace
tsahee Mar 15, 2024
714ca9d
arbitrator ci: update SW versions
tsahee Mar 15, 2024
83d28bc
arbitrator-ci: use an older nightly
tsahee Mar 15, 2024
884051a
Makefile: support specific nightly for stylus
tsahee Mar 15, 2024
99b5511
arbitrator-ci: add rust components
tsahee Mar 15, 2024
0e8a25c
clippy fixes
tsahee Mar 15, 2024
8432de5
rust test fixes
tsahee Mar 15, 2024
70aebed
streaming decompression api with dictionary
rachel-bousfield Mar 16, 2024
72c2ab1
propagate dictionaries
rachel-bousfield Mar 16, 2024
7fe42e8
unified brotli impl with streaming API
rachel-bousfield Mar 18, 2024
4c422c5
go uses arbbrotli
rachel-bousfield Mar 18, 2024
0497d2d
cgo brotli
rachel-bousfield Mar 18, 2024
e8e6f38
MaybeUninit API
rachel-bousfield Mar 18, 2024
faa52f7
full brotli api with stylus adoption
rachel-bousfield Mar 19, 2024
49f7b8c
fix dockerfile + inclusion
rachel-bousfield Mar 19, 2024
1462d8b
fuzzing for brotli
Mar 19, 2024
50828a6
check more invariants
rachel-bousfield Mar 20, 2024
501b216
Merge pull request #213 from OffchainLabs/brotli-fuzz
rachel-bousfield Mar 20, 2024
dec3ad1
cleanup
rachel-bousfield Mar 20, 2024
5dd1e8e
fix test-gen-proofs
rachel-bousfield Mar 20, 2024
661fc11
fix dockerfile
rachel-bousfield Mar 20, 2024
e34567d
make custom dictionaries configurable
rachel-bousfield Mar 20, 2024
5aed139
compress validator modules
rachel-bousfield Mar 21, 2024
ffca5e2
docstrings and optional uncompressed variant
rachel-bousfield Mar 21, 2024
9dedefe
deduplicate compression impl
rachel-bousfield Mar 21, 2024
d7fdff1
minor tweak
rachel-bousfield Mar 21, 2024
1906927
Merge pull request #214 from OffchainLabs/compress-validator-modules
rachel-bousfield Mar 21, 2024
73d48d8
address review comments
rachel-bousfield Mar 21, 2024
1e48f03
fallible dictionary.ptr
rachel-bousfield Mar 21, 2024
a29a046
Merge pull request #209 from OffchainLabs/vm-storage-cache
rachel-bousfield Mar 21, 2024
cec7fc4
Merge pull request #212 from OffchainLabs/custom-brotli-dictionaries
rachel-bousfield Mar 21, 2024
e42cad9
Merge remote-tracking branch 'origin/stylus' into nitro-2.2.5-merge
tsahee Mar 25, 2024
bde6037
cargo update
tsahee Mar 25, 2024
6fb8939
arbcompress: compilation fixes
tsahee Mar 25, 2024
5e07876
cargo fmt
tsahee Mar 25, 2024
ca67357
clippy fix
tsahee Mar 25, 2024
9b81b11
Fix test timeouts in CI
PlasmaPower Mar 23, 2024
8c39832
consolidate stylus params
rachel-bousfield Mar 26, 2024
2406f88
rm cache.go
rachel-bousfield Mar 26, 2024
2a1ff21
fix memory model
rachel-bousfield Mar 26, 2024
f52c292
Merge pull request #215 from OffchainLabs/consolidate-stylus-params
joshuacolvin0 Mar 26, 2024
66c69d7
Merge branch 'stylus' into nitro-2.2.5-merge
rachel-bousfield Mar 26, 2024
377c89c
diffuse self-destruct
rachel-bousfield Mar 28, 2024
15599a8
user_main can only return boolean
tsahee Mar 29, 2024
d2096c6
update module hashes in tests
tsahee Mar 29, 2024
800ffc3
dynamic.wat - update return values
tsahee Mar 29, 2024
92d0c23
Merge pull request #218 from OffchainLabs/user_main_return_value
rachel-bousfield Mar 29, 2024
e075ea0
Merge pull request #217 from OffchainLabs/stylus-dencun-self-destruct
rachel-bousfield Apr 1, 2024
2d7eb25
cached data pricer & minor tweaks
rachel-bousfield Apr 2, 2024
132234f
Merge branch 'stylus' into nitro-2.2.5-merge
rachel-bousfield Apr 2, 2024
a1a5efa
compress prover preloads
rachel-bousfield Apr 3, 2024
307cc8d
fix module serde for Stylus programs
rachel-bousfield Apr 3, 2024
efbf8ea
Merge pull request #211 from OffchainLabs/nitro-2.2.5-merge
rachel-bousfield Apr 3, 2024
2dac42d
Merge branch 'stylus' into compress-prover-preloads
rachel-bousfield Apr 4, 2024
cc51a98
clippy
rachel-bousfield Apr 4, 2024
92a25ce
cleanup
rachel-bousfield Apr 4, 2024
d1e1531
Merge pull request #220 from OffchainLabs/compress-prover-preloads
rachel-bousfield Apr 4, 2024
9c335b0
shrink init gas
rachel-bousfield Apr 4, 2024
d9da195
shrink activatedAt
rachel-bousfield Apr 4, 2024
50215e2
cached init gas record
rachel-bousfield Apr 4, 2024
4a70c18
Merge tag 'v2.3.4-rc.2' into merge-nitro-v2.3.4
tsahee Apr 6, 2024
015e09a
rust + go tidy
tsahee Apr 6, 2024
3e491c7
prover: fix wasm compilation
tsahee Apr 6, 2024
e7d8fb7
add cached bool
rachel-bousfield Apr 6, 2024
1325108
ArbWasmCache precompile
rachel-bousfield Apr 7, 2024
4d8082e
codehashIsCached precompile method + comments
rachel-bousfield Apr 7, 2024
ac07554
simple cache manager + test
rachel-bousfield Apr 8, 2024
5471cc9
simplify program record & fix keepalive bug
rachel-bousfield Apr 8, 2024
ed2db0a
evits + refactor log parsing mechanism
rachel-bousfield Apr 8, 2024
de9229a
managers list precompile method
rachel-bousfield Apr 8, 2024
694a838
fix precompile count
rachel-bousfield Apr 8, 2024
2986073
remove trie table
rachel-bousfield Apr 9, 2024
a5b2143
repin contracts
rachel-bousfield Apr 9, 2024
6228e90
repin contracts
rachel-bousfield Apr 9, 2024
63551f9
CodehashAsmSize precompile method
rachel-bousfield Apr 9, 2024
f057a89
cache last N
rachel-bousfield Apr 9, 2024
0e2e4da
Merge pull request #222 from OffchainLabs/merge-nitro-v2.3.4
rachel-bousfield Apr 9, 2024
c080a10
Merge branch 'stylus' into init-cache
rachel-bousfield Apr 10, 2024
87f64cc
txCacheSize methods
rachel-bousfield Apr 10, 2024
b2611f5
add LRU cache & journaling with Rust stub
rachel-bousfield Apr 11, 2024
0818c72
rust side caching 🦀
rachel-bousfield Apr 11, 2024
c34fc72
address review comments
rachel-bousfield Apr 11, 2024
276d1a6
cargo clippy
rachel-bousfield Apr 11, 2024
260e857
handle reorgs
rachel-bousfield Apr 11, 2024
07bdb3b
tranient storage Host I/Os
rachel-bousfield Apr 12, 2024
20204c3
interleaved tload tstore test
rachel-bousfield Apr 12, 2024
c07f375
update user-test
rachel-bousfield Apr 12, 2024
d858655
add math hostios
rachel-bousfield Apr 12, 2024
d0fa256
add math test
rachel-bousfield Apr 12, 2024
bb7ec12
rust program
rachel-bousfield Apr 12, 2024
a57ba66
add pricing
rachel-bousfield Apr 12, 2024
35af7ac
Merge pull request #224 from OffchainLabs/trans-ops
rachel-bousfield Apr 12, 2024
41521fb
Merge pull request #225 from OffchainLabs/math-hostios
rachel-bousfield Apr 12, 2024
d97b3a2
log fatal wasms
rachel-bousfield Apr 12, 2024
f41a556
Merge pull request #226 from OffchainLabs/log-fatal-wasms
rachel-bousfield Apr 12, 2024
ed86e5a
Merge remote-tracking branch 'stylus/stylus' into init-cache
rachel-bousfield Apr 12, 2024
bc43196
cargo fmt
rachel-bousfield Apr 15, 2024
f368397
repin contracts
rachel-bousfield Apr 15, 2024
c3bff9e
Merge pull request #223 from OffchainLabs/init-cache
rachel-bousfield Apr 15, 2024
372af8a
optimize func merklization
rachel-bousfield Apr 15, 2024
0f05b3e
repin contracts
rachel-bousfield Apr 15, 2024
9ccf708
fix crunch
rachel-bousfield Apr 15, 2024
113a501
repin contracts
rachel-bousfield Apr 15, 2024
edfe58c
Merge pull request #227 from OffchainLabs/optimize-func-merkle
rachel-bousfield Apr 15, 2024
b41bbdf
simplify init cache
rachel-bousfield Apr 16, 2024
0c44124
Merge pull request #228 from OffchainLabs/simplify-init-cache
rachel-bousfield Apr 16, 2024
4a6711b
adopt wasmer v4.2.8
rachel-bousfield Apr 17, 2024
fe7aa8d
use ref types
rachel-bousfield Apr 17, 2024
fa742c7
fixed memory edge case
rachel-bousfield Apr 18, 2024
a26a6cb
exhaustive mem write test
rachel-bousfield Apr 18, 2024
e662650
make Stylus ArbOS 30
rachel-bousfield Apr 19, 2024
2f2067a
cleanup
rachel-bousfield Apr 19, 2024
6404ddb
move arbostypes versions into geth
rachel-bousfield Apr 19, 2024
27408de
Merge pull request #231 from OffchainLabs/stylus-arbos-30
rachel-bousfield Apr 19, 2024
0335ae7
separate out Nitro and Stylus params and chain rules
rachel-bousfield Apr 19, 2024
87df0d7
Merge branch 'stylus' into stylus-arbos-30
rachel-bousfield Apr 19, 2024
652818a
Merge pull request #232 from OffchainLabs/stylus-arbos-30
rachel-bousfield Apr 19, 2024
c8553ac
init pricer & new precompiles
rachel-bousfield Apr 30, 2024
6e6986d
Merge pull request #229 from OffchainLabs/wasmer-v4.2.8
rachel-bousfield Apr 30, 2024
cd68ec8
Merge branch 'stylus' into stylus-mainnet-constants
rachel-bousfield Apr 30, 2024
d8adf7a
Merge remote-tracking branch 'stylus/stylus' into stylus-mainnet-cons…
rachel-bousfield Apr 30, 2024
aa33465
revert wasm hash
rachel-bousfield Apr 30, 2024
80972f7
extra data hash
rachel-bousfield Apr 30, 2024
3c52d85
fix user-test
rachel-bousfield Apr 30, 2024
0e1ade7
update module roots
rachel-bousfield Apr 30, 2024
2323998
fix typo
rachel-bousfield Apr 30, 2024
295401d
revert polynomial change
rachel-bousfield Apr 30, 2024
f7ff909
cargo clippy
rachel-bousfield Apr 30, 2024
a61eee7
ArbOS clones, rather than steals, from the LRU
rachel-bousfield Apr 30, 2024
0f5d875
Update arbitrator/prover/src/binary.rs
rachel-bousfield May 2, 2024
46c29f5
Merge pull request #234 from OffchainLabs/stylus-mainnet-constants
rachel-bousfield May 2, 2024
9cc8f3c
Merge commit 'e6afd28add5c9ff8be5952e3fe546d70015841af' into stylus-n…
rachel-bousfield May 3, 2024
01bbf49
Merge remote-tracking branch 'nitro/master' into stylus-nitro-conflicts
rachel-bousfield May 3, 2024
0e11cb5
fix SendTxAsCall
rachel-bousfield May 3, 2024
6cdb8b5
use actual wasm module root in when validating blocks
rachel-bousfield May 3, 2024
53b80dc
add skips
rachel-bousfield May 3, 2024
3332923
update redis
rachel-bousfield May 3, 2024
0f7847a
Merge branch 'stylus-nitro-conflicts' into fixed-memory-edge-case
rachel-bousfield May 3, 2024
9831b4a
skip for now
rachel-bousfield May 3, 2024
18d70df
fix waitForSequencer usage
rachel-bousfield May 3, 2024
1973921
remove skip
rachel-bousfield May 3, 2024
85f4571
Merge pull request #230 from OffchainLabs/fixed-memory-edge-case
rachel-bousfield May 3, 2024
cbeceea
require debug chains
rachel-bousfield May 3, 2024
b3e7961
repin geth
rachel-bousfield May 3, 2024
dcdc631
repin geth
rachel-bousfield May 3, 2024
328b83c
fix conditionaltx_test
rachel-bousfield May 3, 2024
3b3a1a4
Merge pull request #236 from OffchainLabs/stylus-nitro-conflicts
rachel-bousfield May 3, 2024
bc2a343
switch to nitro modules
rachel-bousfield May 3, 2024
6fd2988
remove PRIVATE_CHECKOUT token
rachel-bousfield May 3, 2024
6127b2d
remove PRIVATE_CHECKOUT token
rachel-bousfield May 3, 2024
e8a8222
CI: codeql wabt
rachel-bousfield May 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,21 @@ brotli/buildfiles/**/*
nitro-testnode/**/*

# Arbitrator ignores
arbitrator/tools/module_roots
arbitrator/tools/pricer

# Rust outputs
arbitrator/target/**/*
arbitrator/target
arbitrator/stylus/tests/*/target/
arbitrator/wasm-testsuite/target/
arbitrator/wasm-libraries/target/
arbitrator/tools/wasmer/target/
arbitrator/tools/wasm-tools/
arbitrator/tools/pricers/
arbitrator/tools/module_roots/
arbitrator/langs/rust/target/
arbitrator/langs/bf/target/

# Compiled files
**/*.o
Expand Down
42 changes: 37 additions & 5 deletions .github/workflows/arbitrator-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ run-name: Arbitrator CI triggered from @${{ github.actor }} of ${{ github.head_r

on:
workflow_dispatch:
inputs:
enable_tmate:
type: boolean
description: 'Enable tmate'
required: false
default: false
merge_group:
pull_request:
paths:
Expand All @@ -16,14 +22,20 @@ on:

env:
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
# RUSTFLAGS: -Dwarnings # TODO: re-enable after wasmer upgrade
WABT_VERSION: 1.0.32

jobs:
arbitrator:
name: Run Arbitrator tests
runs-on: ubuntu-8
steps:
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.enable_tmate }}
with:
detached: true

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -38,7 +50,7 @@ jobs:
- name: Install go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Install custom go-ethereum
run: |
Expand All @@ -59,8 +71,16 @@ jobs:
- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.75"
components: 'llvm-tools-preview, rustfmt, clippy'

- name: Install rust nightly
uses: dtolnay/rust-toolchain@nightly
id: install-rust-nightly
with:
toolchain: "nightly-2024-02-04"
targets: 'wasm32-wasi, wasm32-unknown-unknown'
components: 'rust-src, rustfmt, clippy'

- name: Cache Rust intermediate build products
uses: actions/cache@v3
Expand Down Expand Up @@ -136,16 +156,28 @@ jobs:
run: echo "$HOME/wabt-prefix/bin" >> "$GITHUB_PATH"

- name: Make arbitrator libraries
run: make -j wasm-ci-build
run: make -j wasm-ci-build STYLUS_NIGHTLY_VER="+nightly-2024-02-04"

- name: Clippy check
run: cargo clippy --all --manifest-path arbitrator/Cargo.toml -- -D warnings

- name: Run rust tests
run: cargo test --all --manifest-path arbitrator/Cargo.toml
uses: actions-rs/cargo@v1
with:
command: test
args: -p arbutil -p prover -p jit -p stylus --release --manifest-path arbitrator/prover/Cargo.toml

- name: Rustfmt
run: cargo fmt --all --manifest-path arbitrator/Cargo.toml -- --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: -p arbutil -p prover -p jit -p stylus --manifest-path arbitrator/Cargo.toml -- --check

- name: Rustfmt - langs/rust
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --manifest-path arbitrator/langs/rust/Cargo.toml -- --check

- name: Make proofs from test cases
run: make -j test-gen-proofs
Expand Down
41 changes: 34 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test-mode: [defaults, race, challenge]
test-mode: [defaults, race, challenge, stylus]

steps:
- name: Checkout
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Install go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Install wasm-ld
run: |
Expand All @@ -61,6 +61,21 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install rust nightly
uses: actions-rs/toolchain@v1
id: install-rust-nightly
with:
profile: minimal
toolchain: "nightly"

- name: Install rust wasm targets
run: rustup target add wasm32-wasi wasm32-unknown-unknown

- name: Install nightly wasm targets
run: |
rustup component add rust-src --toolchain nightly
rustup target add wasm32-unknown-unknown --toolchain nightly

- name: Cache Build Products
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -130,23 +145,35 @@ jobs:
if: matrix.test-mode == 'defaults'
run: |
packages=`go list ./...`
gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 -- -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -timeout 20m
stdbuf -oL gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 --no-color=false -- ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -timeout 20m -parallel=8 > >(stdbuf -oL tee full.log | grep -vE "INFO|seal")

- name: run tests with race detection
if: matrix.test-mode == 'race'
run: |
run: |
packages=`go list ./...`
gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 -- -race -timeout 30m
stdbuf -oL gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 --no-color=false -- ./... -race -timeout 30m -parallel=8 > >(stdbuf -oL tee full.log | grep -vE "INFO|seal")

- name: run redis tests
if: matrix.test-mode == 'defaults'
run: TEST_REDIS=redis://localhost:6379/0 gotestsum --format short-verbose -- -p 1 -run TestRedis ./arbnode/... ./system_tests/... -coverprofile=coverage-redis.txt -covermode=atomic -coverpkg=./...

- name: run challenge tests
if: matrix.test-mode == 'challenge'
run: |
run: |
packages=`go list ./...`
stdbuf -oL gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 --no-color=false -- ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -parallel=8 -tags=challengetest -run=TestChallenge > >(stdbuf -oL tee full.log | grep -vE "INFO|seal")

- name: run stylus tests
if: matrix.test-mode == 'stylus'
run: |
packages=`go list ./...`
gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 -- ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -tags=challengetest -run=TestChallenge
stdbuf -oL gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 --no-color=false -- ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -parallel=8 -tags=stylustest -run=TestProgramArbitrator > >(stdbuf -oL tee full.log | grep -vE "INFO|seal")

- name: Archive detailed run log
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.test-mode }}-full.log
path: full.log

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Install go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ target/
yarn-error.log
local/
system_tests/test-data/*
.configs/
system_tests/testdata/*
arbos/testdata/*
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
[submodule "arbitrator/wasm-testsuite/testsuite"]
path = arbitrator/wasm-testsuite/testsuite
url = https://github.com/WebAssembly/testsuite.git
[submodule "arbitrator/tools/wasmer"]
path = arbitrator/tools/wasmer
url = https://github.com/OffchainLabs/wasmer.git
[submodule "nitro-testnode"]
path = nitro-testnode
url = https://github.com/OffchainLabs/nitro-testnode.git
[submodule "arbitrator/langs/rust"]
path = arbitrator/langs/rust
url = https://github.com/OffchainLabs/stylus-sdk-rs.git
[submodule "arbitrator/langs/c"]
path = arbitrator/langs/c
url = https://github.com/OffchainLabs/stylus-sdk-c.git
[submodule "arbitrator/langs/bf"]
path = arbitrator/langs/bf
url = https://github.com/OffchainLabs/stylus-sdk-bf.git
89 changes: 67 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,29 @@ RUN apt-get update && apt-get install -y curl build-essential=12.9

FROM wasm-base as wasm-libs-builder
# clang / lld used by soft-float wasm
RUN apt-get install -y clang=1:14.0-55.7~deb12u1 lld=1:14.0-55.7~deb12u1
# pinned rust 1.70.0
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.70.0 --target x86_64-unknown-linux-gnu wasm32-unknown-unknown wasm32-wasi
RUN apt-get install -y clang=1:14.0-55.7~deb12u1 lld=1:14.0-55.7~deb12u1 wabt
# pinned rust 1.75.0
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.75.0 --target x86_64-unknown-linux-gnu wasm32-unknown-unknown wasm32-wasi
COPY ./Makefile ./
COPY arbitrator/Cargo.* arbitrator/
COPY arbitrator/arbutil arbitrator/arbutil
COPY arbitrator/brotli arbitrator/brotli
COPY arbitrator/caller-env arbitrator/caller-env
COPY arbitrator/prover arbitrator/prover
COPY arbitrator/wasm-libraries arbitrator/wasm-libraries
COPY arbitrator/tools/wasmer arbitrator/tools/wasmer
COPY brotli brotli
COPY scripts/build-brotli.sh scripts/
COPY --from=brotli-wasm-export / target/
RUN apt-get update && apt-get install -y cmake
RUN . ~/.cargo/env && NITRO_BUILD_IGNORE_TIMESTAMPS=1 RUSTFLAGS='-C symbol-mangling-version=v0' make build-wasm-libs

FROM scratch as wasm-libs-export
COPY --from=wasm-libs-builder /workspace/ /

FROM wasm-base as wasm-bin-builder
# pinned go version
RUN curl -L https://golang.org/dl/go1.20.linux-`dpkg --print-architecture`.tar.gz | tar -C /usr/local -xzf -
RUN curl -L https://golang.org/dl/go1.21.7.linux-`dpkg --print-architecture`.tar.gz | tar -C /usr/local -xzf -
COPY ./Makefile ./go.mod ./go.sum ./
COPY ./arbcompress ./arbcompress
COPY ./arbos ./arbos
Expand All @@ -82,41 +90,66 @@ COPY --from=contracts-builder workspace/contracts/node_modules/@offchainlabs/upg
COPY --from=contracts-builder workspace/.make/ .make/
RUN PATH="$PATH:/usr/local/go/bin" NITRO_BUILD_IGNORE_TIMESTAMPS=1 make build-wasm-bin

FROM rust:1.70-slim-bookworm as prover-header-builder
FROM rust:1.75-slim-bullseye as prover-header-builder
WORKDIR /workspace
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y make clang && \
apt-get install -y make clang wabt && \
cargo install --force cbindgen
COPY arbitrator/Cargo.* arbitrator/cbindgen.toml arbitrator/
COPY arbitrator/Cargo.* arbitrator/
COPY ./Makefile ./
COPY arbitrator/arbutil arbitrator/arbutil
COPY arbitrator/brotli arbitrator/brotli
COPY arbitrator/caller-env arbitrator/caller-env
COPY arbitrator/prover arbitrator/prover
COPY arbitrator/wasm-libraries arbitrator/wasm-libraries
COPY arbitrator/jit arbitrator/jit
COPY arbitrator/stylus arbitrator/stylus
COPY arbitrator/tools/wasmer arbitrator/tools/wasmer
COPY --from=brotli-wasm-export / target/
COPY scripts/build-brotli.sh scripts/
COPY brotli brotli
RUN apt-get update && apt-get install -y cmake
RUN NITRO_BUILD_IGNORE_TIMESTAMPS=1 make build-prover-header

FROM scratch as prover-header-export
COPY --from=prover-header-builder /workspace/target/ /

FROM rust:1.75-slim-bookworm as prover-builder
FROM rust:1.75-slim-bullseye as prover-builder
WORKDIR /workspace
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y make wget gpg software-properties-common zlib1g-dev \
libstdc++-11-dev wabt clang llvm-dev libclang-common-14-dev libpolly-14-dev
apt-get install -y make wget gpg software-properties-common zlib1g-dev libstdc++-10-dev wabt
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
add-apt-repository 'deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-15 main' && \
apt-get update && \
apt-get install -y llvm-15-dev libclang-common-15-dev libpolly-15-dev
COPY --from=brotli-library-export / target/
COPY arbitrator/Cargo.* arbitrator/
COPY arbitrator/arbutil arbitrator/arbutil
COPY arbitrator/brotli arbitrator/brotli
COPY arbitrator/caller-env arbitrator/caller-env
COPY arbitrator/prover/Cargo.toml arbitrator/prover/
COPY arbitrator/jit/Cargo.toml arbitrator/jit/
RUN mkdir arbitrator/prover/src arbitrator/jit/src && \
echo "fn test() {}" > arbitrator/jit/src/lib.rs && \
COPY arbitrator/stylus/Cargo.toml arbitrator/stylus/
COPY arbitrator/tools/wasmer arbitrator/tools/wasmer
COPY arbitrator/wasm-libraries/user-host-trait/Cargo.toml arbitrator/wasm-libraries/user-host-trait/Cargo.toml
RUN bash -c 'mkdir arbitrator/{prover,jit,stylus}/src arbitrator/wasm-libraries/user-host-trait/src'
RUN echo "fn test() {}" > arbitrator/jit/src/lib.rs && \
echo "fn test() {}" > arbitrator/prover/src/lib.rs && \
echo "fn test() {}" > arbitrator/stylus/src/lib.rs && \
echo "fn test() {}" > arbitrator/wasm-libraries/user-host-trait/src/lib.rs && \
cargo build --manifest-path arbitrator/Cargo.toml --release --lib && \
rm arbitrator/jit/src/lib.rs
rm arbitrator/prover/src/lib.rs arbitrator/jit/src/lib.rs arbitrator/stylus/src/lib.rs && \
rm arbitrator/wasm-libraries/user-host-trait/src/lib.rs
COPY ./Makefile ./
COPY arbitrator/prover arbitrator/prover
COPY arbitrator/wasm-libraries arbitrator/wasm-libraries
COPY arbitrator/jit arbitrator/jit
COPY --from=brotli-library-export / target/
COPY arbitrator/stylus arbitrator/stylus
COPY --from=brotli-wasm-export / target/
COPY scripts/build-brotli.sh scripts/
COPY brotli brotli
RUN touch -a -m arbitrator/prover/src/lib.rs
RUN NITRO_BUILD_IGNORE_TIMESTAMPS=1 make build-prover-lib
RUN NITRO_BUILD_IGNORE_TIMESTAMPS=1 make build-prover-bin
Expand All @@ -134,7 +167,12 @@ COPY --from=prover-export / target/
COPY --from=wasm-bin-builder /workspace/target/ target/
COPY --from=wasm-bin-builder /workspace/.make/ .make/
COPY --from=wasm-libs-builder /workspace/target/ target/
COPY --from=wasm-libs-builder /workspace/arbitrator/prover/ arbitrator/prover/
COPY --from=wasm-libs-builder /workspace/arbitrator/tools/wasmer/ arbitrator/tools/wasmer/
COPY --from=wasm-libs-builder /workspace/arbitrator/wasm-libraries/ arbitrator/wasm-libraries/
COPY --from=wasm-libs-builder /workspace/arbitrator/arbutil arbitrator/arbutil
COPY --from=wasm-libs-builder /workspace/arbitrator/brotli arbitrator/brotli
COPY --from=wasm-libs-builder /workspace/arbitrator/caller-env arbitrator/caller-env
COPY --from=wasm-libs-builder /workspace/.make/ .make/
COPY ./Makefile ./
COPY ./arbitrator ./arbitrator
Expand All @@ -158,15 +196,22 @@ COPY ./scripts/download-machine.sh .
#RUN ./download-machine.sh consensus-v7 0x53dd4b9a3d807a8cbb4d58fbfc6a0857c3846d46956848cae0a1cc7eca2bb5a8
#RUN ./download-machine.sh consensus-v7.1 0x2b20e1490d1b06299b222f3239b0ae07e750d8f3b4dedd19f500a815c1548bbc
#RUN ./download-machine.sh consensus-v9 0xd1842bfbe047322b3f3b3635b5fe62eb611557784d17ac1d2b1ce9c170af6544
RUN ./download-machine.sh consensus-v10 0x6b94a7fc388fd8ef3def759297828dc311761e88d8179c7ee8d3887dc554f3c3
RUN ./download-machine.sh consensus-v10.1 0xda4e3ad5e7feacb817c21c8d0220da7650fe9051ece68a3f0b1c5d38bbb27b21
RUN ./download-machine.sh consensus-v10.2 0x0754e09320c381566cc0449904c377a52bd34a6b9404432e80afd573b67f7b17
RUN ./download-machine.sh consensus-v10.3 0xf559b6d4fa869472dabce70fe1c15221bdda837533dfd891916836975b434dec
RUN ./download-machine.sh consensus-v11 0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a
RUN ./download-machine.sh consensus-v11.1 0x68e4fe5023f792d4ef584796c84d710303a5e12ea02d6e37e2b5e9c4332507c4
RUN ./download-machine.sh consensus-v20 0x8b104a2e80ac6165dc58b9048de12f301d70b02a0ab51396c22b4b4b802a16a4
#RUN ./download-machine.sh consensus-v10 0x6b94a7fc388fd8ef3def759297828dc311761e88d8179c7ee8d3887dc554f3c3
#RUN ./download-machine.sh consensus-v10.1 0xda4e3ad5e7feacb817c21c8d0220da7650fe9051ece68a3f0b1c5d38bbb27b21
#RUN ./download-machine.sh consensus-v10.2 0x0754e09320c381566cc0449904c377a52bd34a6b9404432e80afd573b67f7b17
#RUN ./download-machine.sh consensus-v10.3 0xf559b6d4fa869472dabce70fe1c15221bdda837533dfd891916836975b434dec
#RUN ./download-machine.sh consensus-v11 0xf4389b835497a910d7ba3ebfb77aa93da985634f3c052de1290360635be40c4a
#RUN ./download-machine.sh consensus-v11.1 0x68e4fe5023f792d4ef584796c84d710303a5e12ea02d6e37e2b5e9c4332507c4
#RUN ./download-machine.sh consensus-v20 0x8b104a2e80ac6165dc58b9048de12f301d70b02a0ab51396c22b4b4b802a16a4

RUN mkdir 0x965a35130f4e34b7b2339eac03b2eacc659e2dafe850d213ea6a7cdf9edfa99f && \
ln -sfT 0x965a35130f4e34b7b2339eac03b2eacc659e2dafe850d213ea6a7cdf9edfa99f latest && \
cd 0x965a35130f4e34b7b2339eac03b2eacc659e2dafe850d213ea6a7cdf9edfa99f && \
wget https://stylus-wasm-17f27dd494229dfd10d4e756f7e2fb953e83bd3d1be8278b33a.s3.us-west-2.amazonaws.com/0x965a35130f4e34b7b2339eac03b2eacc659e2dafe850d213ea6a7cdf9edfa99f/module-root.txt && \
wget https://stylus-wasm-17f27dd494229dfd10d4e756f7e2fb953e83bd3d1be8278b33a.s3.us-west-2.amazonaws.com/0x965a35130f4e34b7b2339eac03b2eacc659e2dafe850d213ea6a7cdf9edfa99f/replay.wasm && \
wget https://stylus-wasm-17f27dd494229dfd10d4e756f7e2fb953e83bd3d1be8278b33a.s3.us-west-2.amazonaws.com/0x965a35130f4e34b7b2339eac03b2eacc659e2dafe850d213ea6a7cdf9edfa99f/machine.wavm.br

FROM golang:1.20-bookworm as node-builder
FROM golang:1.21-bullseye as node-builder
WORKDIR /workspace
ARG version=""
ARG datetime=""
Expand Down
Loading
Loading