Skip to content

Commit c9d2319

Browse files
authored
fix(coprocessor): host-listener regression (#789)
* test(coprocessor): host-listener with correct initial block time * fix(coprocessor): host-listener, regression on block rechecking * test(ci): login to chainguard
1 parent 0386a06 commit c9d2319

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

.github/workflows/test-suite-e2e-tests.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ jobs:
102102
username: ${{ github.actor }}
103103
password: ${{ secrets.GHCR_READ_TOKEN }}
104104

105+
- name: Login to Chainguard Registry
106+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
107+
with:
108+
registry: cgr.dev
109+
username: ${{ secrets.CGR_USERNAME }}
110+
password: ${{ secrets.CGR_PASSWORD }}
111+
105112
- name: Set version from release
106113
if: github.event_name == 'release'
107114
run: |
@@ -150,7 +157,7 @@ jobs:
150157
- name: Public Decryption test
151158
working-directory: test-suite/fhevm
152159
run: |
153-
./fhevm-cli test public-decryption
160+
timeout 5m ./fhevm-cli test public-decryption
154161
155162
- name: User Decryption test
156163
working-directory: test-suite/fhevm
@@ -185,6 +192,9 @@ jobs:
185192
echo "::group::Transaction Sender Logs (filtered)"
186193
./fhevm-cli logs transaction-sender | grep -v "Selected 0 rows to process"
187194
echo "::endgroup::"
195+
echo "::group::Host Listener"
196+
./fhevm-cli logs host-listener
197+
echo "::endgroup::"
188198
189199
- name: Cleanup
190200
working-directory: test-suite/fhevm

coprocessor/fhevm-engine/host-listener/src/cmd/mod.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,16 +546,26 @@ impl InfiniteLogIter {
546546
},
547547
},
548548
};
549+
let current_block_summary = current_block.into();
550+
549551
if !self.block_history.is_ready_to_detect_reorg() {
550552
// at fresh restart no ancestor are known
553+
if has_event {
554+
// we don't add to history from which we have no event
555+
// e.g. at timeout, because empty blocks are not get_logs
556+
self.block_history.add_block(current_block_summary);
557+
}
551558
return;
552559
}
553560

554-
let current_block_summary = current_block.into();
555561
let missing_blocks =
556562
self.get_missings_ancestors(current_block_summary).await;
557-
558563
if missing_blocks.is_empty() {
564+
// we don't add to history from which we have no event
565+
// e.g. at timeout, because empty blocks are not get_logs
566+
if has_event {
567+
self.block_history.add_block(current_block_summary);
568+
}
559569
return; // no reorg
560570
}
561571
warn!(
@@ -564,7 +574,6 @@ impl InfiniteLogIter {
564574
);
565575
self.populate_catchup_logs_from_missing_blocks(missing_blocks)
566576
.await;
567-
// let's maintain the tip block by re-adding at end
568577
// we don't add to history from which we have no event
569578
// e.g. at timeout, because empty blocks are not get_logs
570579
if has_event {

test-suite/fhevm/docker-compose/coprocessor-docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ services:
7676
- --acl-contract-address=${ACL_CONTRACT_ADDRESS}
7777
- --tfhe-contract-address=${FHEVM_EXECUTOR_CONTRACT_ADDRESS}
7878
- --url=${RPC_URL}
79+
- --initial-block-time=1
7980
depends_on:
8081
db:
8182
condition: service_healthy

0 commit comments

Comments
 (0)