Skip to content

[P3] Bridge: align ETH README/docs messageHash with BridgeContract.sol (#1285)#1294

Open
bonujel wants to merge 2 commits into
gonka-ai:upgrade-v0.2.14from
bonujel:fix/1285-readme-messagehash
Open

[P3] Bridge: align ETH README/docs messageHash with BridgeContract.sol (#1285)#1294
bonujel wants to merge 2 commits into
gonka-ai:upgrade-v0.2.14from
bonujel:fix/1285-readme-messagehash

Conversation

@bonujel

@bonujel bonujel commented Jun 3, 2026

Copy link
Copy Markdown

Summary

Closes #1285. The Ethereum bridge docs documented the mint/withdraw signed payload without the address(this) (bridge contract address) field, while the contract source includes it. The chain-side signer already matches the contract, so this is not a production-safety issue — but third-party auditors/integrators following the docs would build an invalid messageHash and hit signature-verification failures.

This brings the docs back in line with BridgeContract.sol.

  • README quickfix — cherry-picks the existing upstream fix (gl/eth-readme-quickfix, commit 7180faa8): adds address(this) to the mint and withdraw messageHash in proposals/ethereum-bridge-contact/README.md.
  • Consistency sweep (beyond the quickfix) — the same inconsistency, plus stale BLS point sizes, existed in two sibling docs. Aligned both with the contract:
    • SETUP.md and ethereum-bridge-contract.md messageHash now include address(this) and the full field order for withdraw and mint.
    • BLS sizes corrected to the EIP-2537 precompile encoding — G1 signature 128 bytes, G2 group key 256 bytes (uncompressed) — replacing the old 48/96-byte compressed figures.
    • Fixed a trailing-comma typo in the mint encoding example.

Docs-only; no code paths touched.

Field order (now matches BridgeContract.sol)

  • withdraw: epochId, GONKA_CHAIN_ID, requestId, ETHEREUM_CHAIN_ID, WITHDRAW_OPERATION, recipient, address(this), tokenContract, amount
  • mint: epochId, GONKA_CHAIN_ID, requestId, ETHEREUM_CHAIN_ID, MINT_OPERATION, recipient, address(this), amount

Test plan

  • Verified mint/withdraw messageHash field order against BridgeContract.sol (keccak256(abi.encodePacked(...)), lines 352/416)
  • Verified BLS sizes against the contract's length checks (signature.length == 128, groupPublicKey.length == 256)
  • Docs-only change — no build/test impact

GLiberman and others added 2 commits June 2, 2026 16:08
…onka-ai#1285)

Beyond the README quickfix, the other two bridge docs carried the same
messageHash inconsistency plus stale BLS point sizes. Align them with the
contract source:

- messageHash now includes address(this) and the full field order for both
  withdraw and mint (matches BridgeContract.sol).
- BLS sizes corrected to the EIP-2537 precompile encoding: G1 signature
  128 bytes, G2 group key 256 bytes (uncompressed), replacing the old
  48/96-byte compressed figures.
- Fixed the trailing-comma typo in the mint encoding example.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tcharchian tcharchian added this to the v0.2.14 milestone Jun 3, 2026
@tcharchian tcharchian linked an issue Jun 3, 2026 that may be closed by this pull request
@bonujel bonujel marked this pull request as ready for review June 3, 2026 05:59
@bonujel

bonujel commented Jun 3, 2026

Copy link
Copy Markdown
Author

Hi @tcharchian , I've opened this PR for #1285 (docs alignment). Whenever you have a moment, I'd really appreciate it if you could take a look. Thank you!

@tcharchian tcharchian requested review from GLiberman and patimen June 3, 2026 22:17
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.

Bridge: merge ETH README messageHash quickfix into v0.2.14

3 participants