Skip to content

test(e2e): freeze a Besu QBFT client with double-sign and time misbehaviour - #1589

Merged
gjermundgaraba merged 1 commit into
mainfrom
fou-1903-misbehaviour
Oct 23, 2026
Merged

gjermundgaraba merged 1 commit into
mainfrom
fou-1903-misbehaviour

Conversation

@gjermundgaraba

@gjermundgaraba gjermundgaraba commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

Stacked on #1588. The QBFT light client freezes on both kinds of misbehaviour it detects, but only fixture tests showed it. Two e2e tests now forge evidence on a live four-validator chain, seal it with a quorum of its validator keys, and submit it through the router as a Headers misbehaviour message.

  • Tests (e2e/besu_misbehaviour_test.go): TestBesuQBFTClient_DoubleSignFreeze pairs a header with a copy at the same height carrying another state root; TestBesuQBFTClient_TimeNonMonotonicityFreeze pairs a header with the next one resealed at its timestamp. Each requires the client's event and frozen state, a FrozenClientState revert for an otherwise valid update, and the next transfer to stay pending.
  • Sealing (cli/besu/header.go): SealHeader sets a header's validators and reseals it under a consensus. Signers must be distinct validators of the set, so it never silently drops a seal.
  • Helper (e2e/internal/e2etest/besu.go): BesuHeaders reads a managed Besu chain's headers, waiting with the chain's timing, and seals forged ones with its validator keys.
  • Signer.BroadcastTx returns the receipt, so tests can read its logs.

Part of FOU-1903 (Linear).

Verification


  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work. (Linear FOU-1903)
  • Include changelog entry when appropriate (e.g. chores should be omitted from changelog). (n/a: CHANGELOG.md only tracks the spec)
  • Wrote unit and e2e tests if relevant.
  • Updated documentation (docs/) if anything is changed. (e2e/README.md, e2e/test-matrix.md)
  • Added godoc comments if relevant.
  • Self-reviewed Files changed in the GitHub PR explorer.
  • Provide a conventional commit message to follow the repository standards.

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Oct 21, 2026

Copy link
Copy Markdown

FOU-1903

@gjermundgaraba gjermundgaraba changed the title fou 1903 misbehaviour test(e2e): freeze a Besu QBFT client with double-sign and time misbehaviour Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Vulnerable dependencies

2 advisories across 2 libraries need attention, 2 accepted.

🚨 Needs attention

github.com/cosmos/evm

In use: v0.7.3 — reached from e2e

Advisory CVE Fixed in Summary
GO-2025-3684 — no fix yet Cosmos EVM Allows Partial Precompile State Writes in github.com/cosmos/evm

Go standard library

In use: go1.26.9 — reached from cli, e2e, gen/go/solidity-abi

Advisory CVE Fixed in Summary
GO-2026-6809 CVE-2026-111943 go1.26.10 Distrust compromised intermediate certificates in crypto/x509

Run make vulncheck for the call paths. Either upgrade the library, or add the
advisory to .govulncheck-ignore with a reason if no fix exists yet.

Accepted

Listed in .govulncheck-ignore with a reason.

github.com/pion/dtls/v2

In use: v2.2.12 — reached from cli

Advisory CVE Fixed in Summary
GO-2026-4479 CVE-2026-26014 no fix yet Usage of random nonce generation with AES GCM ciphers risks leaking the authentication key in github.com/pion/dtls

golang.org/x/crypto

In use: v0.57.0 — reached from cli, e2e

Advisory CVE Fixed in Summary
GO-2026-5932 — no fix yet The golang.org/x/crypto/openpgp package is unmaintained, unsafe by design, and has known security issues

From make vulncheck-json on this run: logs.

@gjermundgaraba
gjermundgaraba marked this pull request as ready for review October 21, 2026 10:09
@gjermundgaraba
gjermundgaraba requested a review from a team as a code owner October 21, 2026 10:09
@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issues were found.

Summary

Adds live QBFT tests for double-sign and non-increasing-time evidence.

  • Besu headers can be resealed with a chosen validator set.
  • Live Besu tests trace misbehaviour evidence through to stuck packets.

Diagram

sequenceDiagram
  participant Test
  participant Source as Source Besu chain
  participant Router as Destination router
  participant Client as QBFT client
  Test->>Source: Read honest headers
  Test->>Test: Forge and seal conflicting evidence
  Test->>Router: submitMisbehaviour
  Router->>Client: Check both headers
  Client-->>Test: Event and frozen state
  Test->>Router: Submit honest update
  Client-->>Test: FrozenClientState
  Test->>Source: Send another transfer
  Test->>Test: Check transfer stays pending
Loading

Reviews (2) · Last reviewed commit: "test(e2e): freeze a Besu QBFT client wit..." · Reviewed by Greptile

@gjermundgaraba
gjermundgaraba force-pushed the fou-1903-misbehaviour branch 2 times, most recently from 3ac5ee5 to 497f004 Compare October 22, 2026 08:33
@gjermundgaraba

Copy link
Copy Markdown
Contributor Author

@greptile review

@gjermundgaraba
gjermundgaraba force-pushed the fou-1903-misbehaviour branch 2 times, most recently from 7ea132d to 454e78d Compare October 22, 2026 13:33
@gjermundgaraba
gjermundgaraba force-pushed the fou-1903-misbehaviour branch 3 times, most recently from 9e94c89 to cb98056 Compare October 22, 2026 19:18
@gjermundgaraba
gjermundgaraba force-pushed the fou-1903-misbehaviour branch 2 times, most recently from 7d1bce2 to e07a794 Compare October 22, 2026 20:40
Base automatically changed from fou-1903-harness to main October 23, 2026 02:05
…aviour

The QBFT light client freezes on both kinds of misbehaviour it detects, but
only fixture tests showed it. Two e2e tests now forge evidence on a live
chain, sealed by a quorum of its validators, and submit it through the
router as a Headers misbehaviour message.

- TestBesuQBFTClient_DoubleSignFreeze pairs a header with a copy at the
  same height carrying another state root.
- TestBesuQBFTClient_TimeNonMonotonicityFreeze pairs a header with the
  next one resealed at its timestamp.
- Each requires the client's event and frozen state, a FrozenClientState
  revert for a valid update, and the next transfer to stay pending.
- besu.SealHeader sets a header's validators and reseals it under a
  consensus with distinct signers that must be among them, and parses the
  result.
- e2etest.BesuHeaders reads a managed Besu chain's headers and seals
  forged ones with its validator keys.
- Signer.BroadcastTx returns the receipt, so tests can read its logs.

Refs: FOU-1903
Signed-off-by: Gjermund Garaba <gjermund@garaba.net>
@gjermundgaraba
gjermundgaraba added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 053e629 Oct 23, 2026
20 of 21 checks passed
@gjermundgaraba
gjermundgaraba deleted the fou-1903-misbehaviour branch October 23, 2026 15:52
dianab-cl pushed a commit that referenced this pull request Oct 26, 2026
…aviour (#1589)

The QBFT light client freezes on both kinds of misbehaviour it detects, but
only fixture tests showed it. Two e2e tests now forge evidence on a live
chain, sealed by a quorum of its validators, and submit it through the
router as a Headers misbehaviour message.

- TestBesuQBFTClient_DoubleSignFreeze pairs a header with a copy at the
  same height carrying another state root.
- TestBesuQBFTClient_TimeNonMonotonicityFreeze pairs a header with the
  next one resealed at its timestamp.
- Each requires the client's event and frozen state, a FrozenClientState
  revert for a valid update, and the next transfer to stay pending.
- besu.SealHeader sets a header's validators and reseals it under a
  consensus with distinct signers that must be among them, and parses the
  result.
- e2etest.BesuHeaders reads a managed Besu chain's headers and seals
  forged ones with its validator keys.
- Signer.BroadcastTx returns the receipt, so tests can read its logs.

Refs: FOU-1903

Signed-off-by: Gjermund Garaba <gjermund@garaba.net>
Signed-off-by: Diana Borbe <diana@cosmoslabs.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants