Skip to content

Commit 30bb151

Browse files
authored
Fix empty batch fix (EspressoSystems#723)
* Should post empty batch when empty batch delay is hit * fix loop check * fix check * add delayed message empty batch post check * revert <= * fix ci * fix lint
1 parent a81001d commit 30bb151

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,17 @@ jobs:
104104
uses: dtolnay/rust-toolchain@stable
105105
id: install-rust
106106
with:
107-
toolchain: '1.84.1'
108-
targets: 'wasm32-wasip1, wasm32-unknown-unknown'
109-
components: 'llvm-tools-preview, rustfmt, clippy'
107+
toolchain: "1.84.1"
108+
targets: "wasm32-wasip1, wasm32-unknown-unknown"
109+
components: "llvm-tools-preview, rustfmt, clippy"
110110

111111
- name: Install rust nightly
112112
uses: dtolnay/rust-toolchain@nightly
113113
id: install-rust-nightly
114114
with:
115-
toolchain: 'nightly-2025-02-14'
116-
targets: 'wasm32-wasip1, wasm32-unknown-unknown'
117-
components: 'rust-src, rustfmt, clippy'
115+
toolchain: "nightly-2025-02-14"
116+
targets: "wasm32-wasip1, wasm32-unknown-unknown"
117+
components: "rust-src, rustfmt, clippy"
118118

119119
- name: Set STYLUS_NIGHTLY_VER environment variable
120120
run: echo "STYLUS_NIGHTLY_VER=+$(rustup toolchain list | grep '^nightly' | head -n1 | cut -d' ' -f1)" >> "$GITHUB_ENV"
@@ -127,6 +127,7 @@ jobs:
127127
uses: foundry-rs/foundry-toolchain@v1
128128
with:
129129
cache: false
130+
version: v1.0.0
130131

131132
- name: Install cbindgen
132133
run: cargo install --force cbindgen
@@ -215,18 +216,18 @@ jobs:
215216
echo "Running redis tests" >> full.log
216217
skip_tests=$(grep -vE '^\s*#|^\s*$' ci_skip_tests | tr '\n' '|' | sed 's/|$//')
217218
gotestsum --format short-verbose -- -p 1 -run TestRedis -skip "$skip_tests" ./arbnode/... ./system_tests/... -coverprofile=coverage-redis.txt -covermode=atomic -coverpkg=./... -- --test_redis=redis://localhost:6379/0
218-
219+
219220
- name: create block input json file
220221
if: matrix.test-mode == 'defaults'
221222
run: |
222223
gotestsum --format short-verbose -- -run TestProgramStorage$ ./system_tests/... --count 1 -- --recordBlockInputs.enable=true --recordBlockInputs.WithBaseDir="${{ github.workspace }}/target" --recordBlockInputs.WithTimestampDirEnabled=false --recordBlockInputs.WithBlockIdInFileNameEnabled=false
223-
224+
224225
- name: run arbitrator prover on block input json
225226
if: matrix.test-mode == 'defaults'
226227
run: |
227228
make build-prover-bin
228229
target/bin/prover target/machines/latest/machine.wavm.br -b --json-inputs="${{ github.workspace }}/target/TestProgramStorage/block_inputs.json"
229-
230+
230231
- name: run jit prover on block input json
231232
if: matrix.test-mode == 'defaults'
232233
run: |
@@ -262,4 +263,4 @@ jobs:
262263
fail_ci_if_error: false
263264
files: ./coverage.txt,./coverage-redis.txt
264265
verbose: false
265-
token: ${{ secrets.CODECOV_TOKEN }}
266+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/espresso-e2e.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ jobs:
7676

7777
- name: Install Foundry
7878
uses: foundry-rs/foundry-toolchain@v1
79+
with:
80+
version: v1.0.0
81+
cache: false
7982

8083
- name: Install rust nightly
8184
uses: dtolnay/rust-toolchain@nightly
@@ -133,7 +136,7 @@ jobs:
133136

134137
- name: Install solidty dependencies
135138
run: cd contracts && yarn install && forge install
136-
139+
137140
- name: Check tool versions
138141
run: |
139142
go version

arbnode/batch_poster.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,6 +2103,14 @@ func (b *BatchPoster) MaybePostSequencerBatch(ctx context.Context) (bool, error)
21032103
breakLoopWhenErrorOccurs = true
21042104
}
21052105

2106+
if b.building.firstDelayedMsg != nil {
2107+
// #nosec G115
2108+
timeSinceMsg := time.Since(time.Unix(int64(b.building.firstDelayedMsg.Message.Header.Timestamp), 0))
2109+
if timeSinceMsg >= config.MaxEmptyBatchDelay {
2110+
forcePostBatch = true
2111+
}
2112+
}
2113+
21062114
for b.building.msgCount < msgCount {
21072115
msg, err := getNextMessage()
21082116
if err != nil {

0 commit comments

Comments
 (0)