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

Support BOLD Challenges on Ethereum Sepolia #1951

Closed
wants to merge 376 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
376 commits
Select commit Hold shift + click to select a range
4e44192
update submodules
rauljordan Oct 18, 2023
2e00527
attempts
rauljordan Oct 18, 2023
c934452
update
rauljordan Oct 18, 2023
8565cfb
more edits
rauljordan Oct 18, 2023
b77ec3a
improve
rauljordan Oct 19, 2023
0e629d0
edits
rauljordan Oct 19, 2023
bd15d2b
use .Free()
amsanghi Oct 19, 2023
691170d
edits to validation
rauljordan Oct 19, 2023
12f2fe4
edits
rauljordan Oct 20, 2023
6bbf0c7
sepolia tooling added
rauljordan Oct 23, 2023
f47efd8
rem tools
rauljordan Oct 23, 2023
2211540
update bold
rauljordan Oct 23, 2023
67ec1b3
rem
rauljordan Oct 24, 2023
307e476
reversions
rauljordan Oct 24, 2023
9ee350f
reversions
rauljordan Oct 24, 2023
9844765
no separate
rauljordan Oct 24, 2023
44dc1d7
config updates
rauljordan Oct 24, 2023
65c5cc8
small
rauljordan Oct 24, 2023
fa70db3
add tooling
rauljordan Oct 24, 2023
7e1e12e
Merge branch 'nitro-bold-testnode' into sepolia-tooling
rauljordan Oct 24, 2023
1d9b1a8
sepolia
rauljordan Oct 25, 2023
c3bd896
edits
rauljordan Oct 25, 2023
a4ea6ee
fixes
rauljordan Oct 25, 2023
6f69dc2
edits
rauljordan Oct 26, 2023
a103375
execution run edits
rauljordan Oct 27, 2023
6efe5e2
update bold commit
rauljordan Oct 31, 2023
98437ce
all edits
rauljordan Nov 1, 2023
9a3770f
edits
rauljordan Nov 1, 2023
83052fb
simplify
rauljordan Nov 1, 2023
3dfdeb7
use configs for intercepting
rauljordan Nov 1, 2023
ae34d92
improvements to configurable evil validators
rauljordan Nov 1, 2023
e9a2b3b
fully configurable bold
rauljordan Nov 1, 2023
9ac0b1c
uncomment
rauljordan Nov 1, 2023
1ff4c6a
intercepts
rauljordan Nov 1, 2023
c142f9f
fully configurable
rauljordan Nov 1, 2023
602b67c
confirm period blocks
rauljordan Nov 1, 2023
02fb4a2
edit commits
rauljordan Nov 1, 2023
78ee0b8
update diffs
rauljordan Nov 3, 2023
da9be1c
sub commit
rauljordan Nov 3, 2023
fcfc3fe
edit
rauljordan Nov 3, 2023
f202d2d
Clean up old cache files
amsanghi Nov 10, 2023
0b3b9fb
Merge branch 'bold' into clean_cache_files
amsanghi Nov 10, 2023
60a17ff
fix lint
amsanghi Nov 10, 2023
c09d56e
Merge branch 'master' into bold
amsanghi Nov 15, 2023
3eb482e
fix go.mod
amsanghi Nov 15, 2023
a8fc94b
Update bold
amsanghi Nov 15, 2023
4b8676d
Add State provider fixes
amsanghi Nov 15, 2023
cf66af4
Merge branch 'fix_state_provider' into staker_bold
amsanghi Nov 15, 2023
8b72013
minor fix
amsanghi Nov 15, 2023
fad6d7f
Minor fix
amsanghi Nov 15, 2023
a237cf2
Use config
amsanghi Nov 15, 2023
b19e9d5
Merge branch 'staker_bold' into mmap
amsanghi Nov 15, 2023
1acfeba
Merge branch 'fix_state_provider' into clean_cache_files
amsanghi Nov 15, 2023
d9c661b
Bold Deploy
amsanghi Nov 15, 2023
4441a37
update commits
rauljordan Nov 17, 2023
956d84b
Merge branch 'master' into bold
amsanghi Nov 28, 2023
b2e6412
Merge branch 'bold' into fix_state_provider
amsanghi Nov 28, 2023
8f3222b
Merge pull request #1968 from OffchainLabs/fix_state_provider
amsanghi Nov 28, 2023
6cf6f5c
Merge branch 'bold' into clean_cache_files
amsanghi Nov 28, 2023
b16afd7
Merge pull request #1961 from OffchainLabs/clean_cache_files
amsanghi Nov 28, 2023
8b68e35
Merge branch 'bold' into staker_bold
amsanghi Nov 28, 2023
9f46865
Merge pull request #1836 from OffchainLabs/staker_bold
amsanghi Nov 28, 2023
71a6439
Merge branch 'bold' into mmap
amsanghi Nov 28, 2023
038d8ac
Merge pull request #1931 from OffchainLabs/mmap
amsanghi Nov 28, 2023
373cbff
Merge branch 'bold' into bold-deploy
amsanghi Nov 28, 2023
8634698
Merge pull request #1969 from OffchainLabs/bold-deploy
amsanghi Nov 28, 2023
4c4dd3a
Add large assertions test
amsanghi Nov 28, 2023
0b7480e
minor fix
amsanghi Nov 28, 2023
401b80f
minor fix
amsanghi Nov 29, 2023
3f0d737
minor fix
amsanghi Nov 29, 2023
4187bf5
Merge branch 'master' into bold
amsanghi Nov 29, 2023
b580f24
minor fix
amsanghi Nov 29, 2023
f1adaf2
minor fix
amsanghi Nov 29, 2023
eab9cf2
update commits
rauljordan Nov 29, 2023
7d48a5d
fix build
amsanghi Dec 1, 2023
a58ebec
fix build
amsanghi Dec 1, 2023
dc75fa0
fix test
amsanghi Dec 1, 2023
b9af2db
fix build
amsanghi Dec 1, 2023
1c3a608
Merge branch 'master' into bold
amsanghi Dec 1, 2023
9b1e4aa
Merge branch 'master' into bold
amsanghi Dec 6, 2023
34d0036
sync all edits
rauljordan Dec 6, 2023
eddad1c
test revert
rauljordan Dec 6, 2023
2d60892
edits
rauljordan Dec 6, 2023
85c3fb2
edits
rauljordan Dec 6, 2023
b3152ee
edits
rauljordan Dec 6, 2023
02e9d00
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Dec 6, 2023
050a6bb
sync
rauljordan Dec 6, 2023
b70c965
update submods
rauljordan Dec 6, 2023
394a495
reverts
rauljordan Dec 6, 2023
a12d9f3
update bold
rauljordan Dec 7, 2023
b951a10
updates
rauljordan Dec 8, 2023
d499622
update bold
rauljordan Dec 8, 2023
f56f3af
edit refs
rauljordan Dec 12, 2023
47d56ba
fix
rauljordan Dec 12, 2023
f3cee74
Revert "fix"
rauljordan Dec 12, 2023
f474258
custom confirm
rauljordan Dec 12, 2023
0258251
show progress of execution server
rauljordan Dec 12, 2023
9ac883b
always merkleize under certain step sizes
rauljordan Dec 13, 2023
9837dc7
change constants
rauljordan Dec 13, 2023
c94a1a0
bold branch
rauljordan Dec 13, 2023
201a3e8
fix up input
rauljordan Dec 13, 2023
bda5695
fixes
rauljordan Dec 13, 2023
77e0abc
deploy fix
rauljordan Dec 13, 2023
431b1fc
recache if always merkleize on
rauljordan Dec 13, 2023
6fba3af
tooling fixes
rauljordan Dec 13, 2023
8209ced
update recache
rauljordan Dec 13, 2023
186e21a
update levels
rauljordan Dec 13, 2023
5a0b949
more edits
rauljordan Dec 14, 2023
9c16e37
edit bold tooling
rauljordan Jan 20, 2024
4da2759
sum
rauljordan Jan 21, 2024
2b87e5c
include api
rauljordan Jan 22, 2024
ad4486e
update bold pr
rauljordan Jan 22, 2024
903e4d2
update bold commit
rauljordan Jan 23, 2024
9fce090
update deploy
rauljordan Jan 23, 2024
8cff433
edit state provider
rauljordan Jan 23, 2024
efe7842
edit exec run
rauljordan Jan 23, 2024
ac77aec
always merkleize
rauljordan Jan 23, 2024
bf9c32f
cap of 2
rauljordan Jan 23, 2024
d5dd021
edit
rauljordan Jan 23, 2024
9d0a907
cap fix
rauljordan Jan 23, 2024
cd8c924
fee cap
rauljordan Jan 23, 2024
4fccdf3
cap
rauljordan Jan 23, 2024
f238f38
edit
rauljordan Jan 23, 2024
48a0db7
edits
rauljordan Jan 23, 2024
f780106
cap
rauljordan Jan 23, 2024
924c824
edit
rauljordan Jan 23, 2024
161111f
edits
rauljordan Jan 24, 2024
747e591
bold commit
rauljordan Jan 24, 2024
e08eca0
bold commit update
rauljordan Jan 24, 2024
d36b696
no merkleize
rauljordan Jan 24, 2024
d42cb46
edit
rauljordan Jan 26, 2024
68a5625
update bold
rauljordan Jan 26, 2024
6f92b26
update bold commit
rauljordan Jan 27, 2024
d31ff4d
update bold commit
rauljordan Jan 27, 2024
45cdf4e
confirm blocks
rauljordan Jan 28, 2024
d2e357f
edit bold
rauljordan Jan 28, 2024
35c8f6b
more logging
rauljordan Jan 28, 2024
b25e1ad
edit
rauljordan Jan 28, 2024
5a71732
stringify validation entry
rauljordan Jan 30, 2024
10eb81a
fix test build
amsanghi Jan 31, 2024
1a8fa04
bold dep
rauljordan Feb 2, 2024
68e1512
sepolia commit
rauljordan Feb 2, 2024
fba1b65
bold commit
rauljordan Feb 5, 2024
43877dc
edit run
rauljordan Feb 5, 2024
a518143
tidy
rauljordan Feb 5, 2024
fca3fae
update bold
rauljordan Feb 5, 2024
1bed001
rev geth
rauljordan Feb 5, 2024
1d2eb1c
Make sure execution node is alive while waiting for computing hashes
amsanghi Feb 6, 2024
edd3d33
Minor fix
amsanghi Feb 6, 2024
8674940
add logging
rauljordan Feb 6, 2024
8e0f286
loggig
rauljordan Feb 6, 2024
9078eef
bold commit
rauljordan Feb 6, 2024
0f38f2a
edit bold
rauljordan Feb 6, 2024
7b7cd3c
add log
rauljordan Feb 6, 2024
ac9f51d
Merge branch 'sepolia-tooling' into execution_check_alive
rauljordan Feb 7, 2024
8a760ff
Merge pull request #2130 from OffchainLabs/execution_check_alive
rauljordan Feb 7, 2024
3851014
update bold
rauljordan Feb 7, 2024
efba9e0
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 7, 2024
79707bf
tidy
rauljordan Feb 7, 2024
c04d1b6
fix cross device link
rauljordan Feb 7, 2024
44aa9e0
credits
rauljordan Feb 7, 2024
74b96a3
Revert "tidy"
rauljordan Feb 7, 2024
2076266
Revert "tidy"
rauljordan Feb 7, 2024
174350c
update bold
rauljordan Feb 7, 2024
7e71860
tidy
rauljordan Feb 7, 2024
0ea2f81
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 7, 2024
294113a
update bold
rauljordan Feb 7, 2024
fbe8f26
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 7, 2024
4ba2ece
update bold
rauljordan Feb 9, 2024
047ba93
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 9, 2024
dd76958
update main
rauljordan Feb 9, 2024
c12bca4
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 9, 2024
312347a
set the nil
rauljordan Feb 9, 2024
f35c3cf
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 9, 2024
d9cd4bb
update bold
rauljordan Feb 12, 2024
d946246
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 12, 2024
cc40d05
edit bold
rauljordan Feb 12, 2024
ab36abd
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 12, 2024
719d8f2
update db
rauljordan Feb 12, 2024
00e937e
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 12, 2024
be74245
edit bold
rauljordan Feb 13, 2024
b025b6b
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 13, 2024
e40fffa
edit nitro
rauljordan Feb 13, 2024
f2266bb
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 13, 2024
d7024f1
fixup
rauljordan Feb 14, 2024
6adabdf
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 14, 2024
68f0059
bold sub
rauljordan Feb 15, 2024
2305f12
yMerge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into…
rauljordan Feb 15, 2024
c8d5044
moar edits
rauljordan Feb 15, 2024
ede0c3c
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 15, 2024
587c4fc
edits
rauljordan Feb 15, 2024
9964c09
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 15, 2024
cbd7e23
bold commit
rauljordan Feb 15, 2024
080d0d5
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 15, 2024
fd4257e
clear
rauljordan Feb 15, 2024
8d7dc03
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 15, 2024
083b9d8
add claim
rauljordan Feb 15, 2024
5f69c6f
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 15, 2024
6e7c6ce
Fix API getting stuck
amsanghi Feb 20, 2024
9b94bb1
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 20, 2024
bff803a
update bold
rauljordan Feb 23, 2024
12d2874
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 23, 2024
9493ba6
stake manager
rauljordan Feb 23, 2024
a2fc95a
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 23, 2024
d8348bf
edits
rauljordan Feb 23, 2024
aeffb14
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 23, 2024
cd98a3c
edits
rauljordan Feb 23, 2024
a9e842c
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 23, 2024
36c17b8
edits
rauljordan Feb 23, 2024
b056785
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 23, 2024
aaf9067
log the batch
rauljordan Feb 23, 2024
282afb4
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Feb 23, 2024
1f4584f
update
rauljordan Feb 27, 2024
ef7c55f
use bottom up timer
rauljordan Feb 28, 2024
db6118e
update bold march challenge
rauljordan Mar 5, 2024
ffb4de0
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Mar 5, 2024
8c72c37
fix the data poster stuff
rauljordan Mar 5, 2024
8ba1e2d
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Mar 5, 2024
ddfc237
build issues
rauljordan Mar 5, 2024
5ff858d
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Mar 5, 2024
341f816
bold commit
rauljordan Mar 6, 2024
1f18f18
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Mar 6, 2024
b558c27
edits
rauljordan Mar 6, 2024
9439af0
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Mar 6, 2024
7c9d17c
inherited
rauljordan Mar 6, 2024
1bceddb
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Mar 6, 2024
c2c91e6
edit bold
rauljordan Mar 6, 2024
62744f9
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Mar 6, 2024
42a66cc
bold edit
rauljordan Mar 6, 2024
ec06a08
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Mar 6, 2024
6853b8e
bold
rauljordan Mar 6, 2024
785f5ae
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Mar 6, 2024
b22fb74
bump
rauljordan Mar 6, 2024
ad3c15f
Merge branch 'sepolia-tooling' of github.com:OffchainLabs/nitro into …
rauljordan Mar 6, 2024
e7be950
edit
rauljordan Mar 7, 2024
ddbfbd9
enable
rauljordan Mar 7, 2024
4dc2a90
edit
rauljordan Mar 8, 2024
9137a60
does not match onchain
rauljordan Mar 8, 2024
a2741b8
updateb old
rauljordan Mar 8, 2024
5d6674e
update
rauljordan Mar 8, 2024
94ce968
edit
rauljordan Mar 8, 2024
c838dd2
bold update
rauljordan Mar 8, 2024
2195840
bold
rauljordan Mar 8, 2024
92070d1
edit bold
rauljordan Mar 8, 2024
3e371a0
update both
rauljordan Mar 8, 2024
6664846
up
rauljordan Mar 8, 2024
e223abe
edit
rauljordan Mar 8, 2024
8f64fa8
fix
rauljordan Mar 8, 2024
56599c4
edit
rauljordan Mar 8, 2024
afcc42e
edit
rauljordan Mar 8, 2024
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
[submodule "nitro-testnode"]
path = nitro-testnode
url = https://github.com/OffchainLabs/nitro-testnode.git
[submodule "bold"]
path = bold
url = https://github.com/OffchainLabs/bold.git
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ COPY ./contracts/package.json ./contracts/yarn.lock ./contracts/
COPY ./solgen/gen.go ./solgen/
COPY ./fastcache ./fastcache
COPY ./go-ethereum ./go-ethereum
COPY ./bold ./bold
COPY --from=brotli-wasm-export / target/
COPY --from=contracts-builder workspace/contracts/build/contracts/src/precompiles/ contracts/build/contracts/src/precompiles/
COPY --from=contracts-builder workspace/contracts/node_modules/@offchainlabs/upgrade-executor/build/contracts/src/UpgradeExecutor.sol/UpgradeExecutor.json contracts/
Expand Down Expand Up @@ -179,6 +180,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
COPY go.mod go.sum ./
COPY go-ethereum/go.mod go-ethereum/go.sum go-ethereum/
COPY fastcache/go.mod fastcache/go.sum fastcache/
COPY bold/go.mod bold/go.sum bold/
RUN go mod download
COPY . ./
COPY --from=contracts-builder workspace/contracts/build/ contracts/build/
Expand Down Expand Up @@ -251,6 +253,7 @@ USER root
RUN rm -f /home/user/target/machines/latest
COPY --from=prover-export /bin/jit /usr/local/bin/
COPY --from=node-builder /workspace/target/bin/deploy /usr/local/bin/
COPY --from=node-builder /workspace/target/bin/bold-deploy /usr/local/bin/
COPY --from=node-builder /workspace/target/bin/seq-coordinator-invalidate /usr/local/bin/
COPY --from=module-root-calc /workspace/target/machines/latest/machine.wavm.br /home/user/target/machines/latest/
COPY --from=module-root-calc /workspace/target/machines/latest/until-host-io-state.bin /home/user/target/machines/latest/
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ push: lint test-go .make/fmt
all: build build-replay-env test-gen-proofs
@touch .make/all

build: $(patsubst %,$(output_root)/bin/%, nitro deploy relay daserver datool seq-coordinator-invalidate nitro-val seq-coordinator-manager)
build: $(patsubst %,$(output_root)/bin/%, nitro deploy bold-deploy relay daserver datool seq-coordinator-invalidate nitro-val seq-coordinator-manager)
@printf $(done)

build-node-deps: $(go_source) build-prover-header build-prover-lib build-jit .make/solgen .make/cbrotli-lib
Expand Down Expand Up @@ -170,6 +170,9 @@ $(output_root)/bin/nitro: $(DEP_PREDICATE) build-node-deps
$(output_root)/bin/deploy: $(DEP_PREDICATE) build-node-deps
go build $(GOLANG_PARAMS) -o $@ "$(CURDIR)/cmd/deploy"

$(output_root)/bin/bold-deploy: $(DEP_PREDICATE) build-node-deps
go build $(GOLANG_PARAMS) -o $@ "$(CURDIR)/cmd/bold-deploy"

$(output_root)/bin/relay: $(DEP_PREDICATE) build-node-deps
go build $(GOLANG_PARAMS) -o $@ "$(CURDIR)/cmd/relay"

Expand Down
11 changes: 9 additions & 2 deletions arbitrator/prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,17 @@ unsafe fn arbitrator_load_machine_impl(
}

#[no_mangle]
pub unsafe extern "C" fn arbitrator_load_wavm_binary(binary_path: *const c_char) -> *mut Machine {
pub unsafe extern "C" fn arbitrator_load_wavm_binary(
binary_path: *const c_char,
always_merkleize: u8,
) -> *mut Machine {
let binary_path = cstr_to_string(binary_path);
let binary_path = Path::new(&binary_path);
match Machine::new_from_wavm(binary_path) {
let mut merkleize = false;
if always_merkleize == 1 {
merkleize = true;
}
match Machine::new_from_wavm(binary_path, merkleize) {
Ok(mach) => Box::into_raw(Box::new(mach)),
Err(err) => {
eprintln!("Error loading binary: {}", err);
Expand Down
14 changes: 12 additions & 2 deletions arbitrator/prover/src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ impl Machine {
Ok(mach)
}

pub fn new_from_wavm(wavm_binary: &Path) -> Result<Machine> {
pub fn new_from_wavm(wavm_binary: &Path, always_merkleize: bool) -> Result<Machine> {
let f = BufReader::new(File::open(wavm_binary)?);
let decompressor = brotli2::read::BrotliDecoder::new(f);
let mut modules: Vec<Module> = bincode::deserialize_from(decompressor)?;
Expand All @@ -1191,6 +1191,16 @@ impl Machine {
MerkleType::Function,
module.funcs.iter().map(Function::hash).collect(),
));
if always_merkleize {
module.memory.cache_merkle_tree();
}
}
let mut modules_merkle = None;
if always_merkleize {
modules_merkle = Some(Merkle::new(
MerkleType::Module,
modules.iter().map(Module::hash).collect(),
));
}
let mut mach = Machine {
status: MachineStatus::Running,
Expand All @@ -1199,7 +1209,7 @@ impl Machine {
internal_stack: Vec::new(),
frame_stack: Vec::new(),
modules,
modules_merkle: None,
modules_merkle,
global_state: Default::default(),
pc: ProgramCounter::default(),
stdio_output: Vec::new(),
Expand Down
27 changes: 20 additions & 7 deletions arbnode/dataposter/data_poster.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,11 @@ func (p *DataPoster) Sender() common.Address {
}

func (p *DataPoster) MaxMempoolTransactions() uint64 {
if p.usingNoOpStorage {
return 1
}
return p.config().MaxMempoolTransactions
// if p.usingNoOpStorage {
// return 1
// }
// return p.config().MaxMempoolTransactions
return 1000
}

// Does basic check whether posting transaction with specified nonce would
Expand Down Expand Up @@ -491,6 +492,18 @@ func (p *DataPoster) PostTransaction(ctx context.Context, dataCreatedAt time.Tim
return fullTx, p.sendTx(ctx, nil, &queuedTx)
}

func (p *DataPoster) PostSimpleTransactionAutoNonce(ctx context.Context, to common.Address, calldata []byte, gasLimit uint64, value *big.Int) (*types.Transaction, error) {
nonce, _, err := p.GetNextNonceAndMeta(ctx)
if err != nil {
return nil, err
}
return p.PostSimpleTransaction(ctx, nonce, to, calldata, gasLimit, value)
}

func (p *DataPoster) PostSimpleTransaction(ctx context.Context, nonce uint64, to common.Address, calldata []byte, gasLimit uint64, value *big.Int) (*types.Transaction, error) {
return p.PostTransaction(ctx, time.Now(), nonce, nil, to, calldata, gasLimit, value, nil)
}

// the mutex must be held by the caller
func (p *DataPoster) saveTx(ctx context.Context, prevTx, newTx *storage.QueuedTransaction) error {
if prevTx != nil && prevTx.Data.Nonce != newTx.Data.Nonce {
Expand Down Expand Up @@ -826,7 +839,7 @@ var DefaultDataPosterConfig = DataPosterConfig{
WaitForL1Finality: true,
TargetPriceGwei: 60.,
UrgencyGwei: 2.,
MaxMempoolTransactions: 10,
MaxMempoolTransactions: 1000,
MinTipCapGwei: 0.05,
MaxTipCapGwei: 5,
NonceRbfSoftConfs: 1,
Expand All @@ -840,7 +853,7 @@ var DefaultDataPosterConfig = DataPosterConfig{

var DefaultDataPosterConfigForValidator = func() DataPosterConfig {
config := DefaultDataPosterConfig
config.MaxMempoolTransactions = 1 // the validator cannot queue transactions
config.MaxMempoolTransactions = 1000
return config
}()

Expand All @@ -850,7 +863,7 @@ var TestDataPosterConfig = DataPosterConfig{
WaitForL1Finality: false,
TargetPriceGwei: 60.,
UrgencyGwei: 2.,
MaxMempoolTransactions: 10,
MaxMempoolTransactions: 1000,
MinTipCapGwei: 0.05,
MaxTipCapGwei: 5,
NonceRbfSoftConfs: 1,
Expand Down
94 changes: 93 additions & 1 deletion arbnode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ import (
"strings"
"time"

solimpl "github.com/OffchainLabs/bold/chain-abstraction/sol-implementation"
challengemanager "github.com/OffchainLabs/bold/challenge-manager"
flag "github.com/spf13/pflag"

modes "github.com/OffchainLabs/bold/challenge-manager/types"
l2stateprovider "github.com/OffchainLabs/bold/layer2-state-provider"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
Expand Down Expand Up @@ -91,6 +95,7 @@ type Config struct {
TransactionStreamer TransactionStreamerConfig `koanf:"transaction-streamer" reload:"hot"`
Maintenance MaintenanceConfig `koanf:"maintenance" reload:"hot"`
ResourceMgmt resourcemanager.Config `koanf:"resource-mgmt" reload:"hot"`
Bold staker.BoldConfig `koanf:"bold" reload:"hot"`
}

func (c *Config) Validate() error {
Expand Down Expand Up @@ -118,6 +123,9 @@ func (c *Config) Validate() error {
if err := c.Staker.Validate(); err != nil {
return err
}
if err := c.Bold.Validate(); err != nil {
return err
}
return nil
}

Expand Down Expand Up @@ -158,6 +166,7 @@ var ConfigDefault = Config{
MessagePruner: DefaultMessagePrunerConfig,
BlockValidator: staker.DefaultBlockValidatorConfig,
Feed: broadcastclient.FeedConfigDefault,
Bold: staker.DefaultBoldConfig,
Staker: staker.DefaultL1ValidatorConfig,
SeqCoordinator: DefaultSeqCoordinatorConfig,
DataAvailability: das.DefaultDataAvailabilityConfig,
Expand Down Expand Up @@ -546,6 +555,89 @@ func createNodeImpl(
statelessBlockValidator = nil
}

if config.Bold.Enable {
dp, err := StakerDataposter(
ctx,
rawdb.NewTable(arbDb, storage.StakerPrefix),
l1Reader,
txOptsValidator,
configFetcher,
syncMonitor,
)
if err != nil {
return nil, err
}
rollupBindings, err := rollupgen.NewRollupUserLogic(deployInfo.Rollup, l1client)
if err != nil {
return nil, fmt.Errorf("could not create rollup bindings: %w", err)
}
chalManager, err := rollupBindings.ChallengeManager(&bind.CallOpts{})
if err != nil {
return nil, fmt.Errorf("could not get challenge manager: %w", err)
}
assertionChain, err := solimpl.NewAssertionChain(ctx, deployInfo.Rollup, chalManager, txOptsValidator, l1client, solimpl.NewDataPosterTransactor(dp))
if err != nil {
return nil, fmt.Errorf("could not create assertion chain: %w", err)
}
blockChallengeLeafHeight := l2stateprovider.Height(config.Bold.BlockChallengeLeafHeight)
bigStepHeight := l2stateprovider.Height(config.Bold.BigStepLeafHeight)
smallStepHeight := l2stateprovider.Height(config.Bold.SmallStepLeafHeight)
stateManager, err := staker.NewStateManager(
statelessBlockValidator,
config.Bold.MachineLeavesCachePath,
[]l2stateprovider.Height{
blockChallengeLeafHeight,
bigStepHeight,
smallStepHeight,
},
config.Bold.ValidatorName,
)
if err != nil {
return nil, fmt.Errorf("could not create state manager: %w", err)
}
providerHeights := []l2stateprovider.Height{blockChallengeLeafHeight}
for i := uint64(0); i < config.Bold.NumBigSteps; i++ {
providerHeights = append(providerHeights, bigStepHeight)
}
providerHeights = append(providerHeights, smallStepHeight)
provider := l2stateprovider.NewHistoryCommitmentProvider(
stateManager,
stateManager,
stateManager,
providerHeights,
stateManager,
nil,
)
postingInterval := time.Second * time.Duration(config.Bold.AssertionPostingIntervalSeconds)
scanningInteval := time.Second * time.Duration(config.Bold.AssertionScanningIntervalSeconds)
confirmingInterval := time.Second * time.Duration(config.Bold.AssertionConfirmingIntervalSeconds)
edgeWakeInterval := time.Second * time.Duration(config.Bold.EdgeTrackerWakeIntervalSeconds)
opts := []challengemanager.Opt{
challengemanager.WithName(config.Bold.ValidatorName),
challengemanager.WithMode(modes.MakeMode), // TODO: Customize.
challengemanager.WithAssertionPostingInterval(postingInterval),
challengemanager.WithAssertionScanningInterval(scanningInteval),
challengemanager.WithAssertionConfirmingInterval(confirmingInterval),
challengemanager.WithEdgeTrackerWakeInterval(edgeWakeInterval),
challengemanager.WithAddress(txOptsValidator.From),
}
if config.Bold.API {
opts = append(opts, challengemanager.WithAPIEnabled(fmt.Sprintf("%s:%d", config.Bold.APIHost, config.Bold.APIPort), config.Bold.APIDBPath))
}
manager, err := challengemanager.New(
ctx,
assertionChain,
provider,
assertionChain.RollupAddress(),
opts...,
)
if err != nil {
return nil, fmt.Errorf("could not create challenge manager: %w", err)
}
provider.UpdateAPIDatabase(manager.Database())
go manager.Start(ctx)
}

var blockValidator *staker.BlockValidator
if config.ValidatorRequired() {
blockValidator, err = staker.NewBlockValidator(
Expand Down Expand Up @@ -611,7 +703,7 @@ func createNodeImpl(
confirmedNotifiers = append(confirmedNotifiers, messagePruner)
}

stakerObj, err = staker.NewStaker(l1Reader, wallet, bind.CallOpts{}, config.Staker, blockValidator, statelessBlockValidator, nil, confirmedNotifiers, deployInfo.ValidatorUtils, fatalErrChan)
stakerObj, err = staker.NewStaker(l1Reader, wallet, bind.CallOpts{}, config.Staker, blockValidator, statelessBlockValidator, nil, confirmedNotifiers, deployInfo.ValidatorUtils, deployInfo.Bridge, fatalErrChan)
if err != nil {
return nil, err
}
Expand Down
55 changes: 54 additions & 1 deletion arbos/block_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,27 @@ func NoopSequencingHooks() *SequencingHooks {
}
}

type ProduceConfig struct {
evil bool
interceptDepositGweiAmount *big.Int
}
type ProduceOpt func(*ProduceConfig)

func WithEvilProduction() ProduceOpt {
return func(pc *ProduceConfig) {
pc.evil = true
}
}

func WithInterceptDepositSize(depositGwei *big.Int) ProduceOpt {
return func(pc *ProduceConfig) {
pc.interceptDepositGweiAmount = depositGwei
}
}

// By default, intercept and modify any Arbitrum deposits with a value of a 1M gwei, or 0.001 ETH.
var DefaultEvilInterceptDepositGweiAmount = big.NewInt(1_000_000 * params.GWei) // 0.001 ETH

func ProduceBlock(
message *arbostypes.L1IncomingMessage,
delayedMessagesRead uint64,
Expand All @@ -133,6 +154,7 @@ func ProduceBlock(
chainContext core.ChainContext,
chainConfig *params.ChainConfig,
batchFetcher arbostypes.FallibleBatchFetcher,
opts ...ProduceOpt,
) (*types.Block, types.Receipts, error) {
var batchFetchErr error
txes, err := ParseL2Transactions(message, chainConfig.ChainID, func(batchNum uint64, batchHash common.Hash) []byte {
Expand All @@ -156,9 +178,40 @@ func ProduceBlock(
txes = types.Transactions{}
}

produceCfg := &ProduceConfig{
interceptDepositGweiAmount: DefaultEvilInterceptDepositGweiAmount,
}
for _, o := range opts {
o(produceCfg)
}

var modifiedTxs []*types.Transaction
if produceCfg.evil {
modifiedTxs = make([]*types.Transaction, 0, len(txes))
for _, tx := range txes {
txData, ok := tx.GetInner().(*types.ArbitrumDepositTx)
if !ok {
// We only intercept Arbitrum deposit txs at the moment.
modifiedTxs = append(modifiedTxs, tx)
continue
}
if txData.Value.Cmp(produceCfg.interceptDepositGweiAmount) != 0 {
modifiedTxs = append(modifiedTxs, tx)
continue
}
newValue := new(big.Int).Add(txData.Value, big.NewInt(params.GWei))
log.Info(fmt.Sprintf("Modified tx value in evil validator with value %d, to value %d as hex %#x and %#x", txData.Value.Uint64(), newValue.Uint64(), txData.Value.Bytes(), newValue.Bytes()))
txData.Value = newValue
modified := types.NewTx(txData)
modifiedTxs = append(modifiedTxs, modified)
}
} else {
modifiedTxs = txes
}

hooks := NoopSequencingHooks()
return ProduceBlockAdvanced(
message.Header, txes, delayedMessagesRead, lastBlockHeader, statedb, chainContext, chainConfig, hooks,
message.Header, modifiedTxs, delayedMessagesRead, lastBlockHeader, statedb, chainContext, chainConfig, hooks,
)
}

Expand Down
1 change: 1 addition & 0 deletions bold
Submodule bold added at 9634e7
Loading