Skip to content

feat: fix Amoy P2P connectivity — genesis, fork ID, eth/69 handshake#86

Merged
VAIBHAVJINDAL3012 merged 1 commit intomainfrom
feature/span-prefetch-pipeline
Mar 12, 2026
Merged

feat: fix Amoy P2P connectivity — genesis, fork ID, eth/69 handshake#86
VAIBHAVJINDAL3012 merged 1 commit intomainfrom
feature/span-prefetch-pipeline

Conversation

@VAIBHAVJINDAL3012
Copy link
Copy Markdown
Contributor

Summary

  • Custom eth/69 handshake: Go-Bor's eth/69 Status includes a TD field (8 fields) that standard EIP-7642 removed. BorRlpxHandshake handles both Go-Bor and standard formats with fallback decoding.
  • Fork ID fix: Exclude Bor-specific forks from EIP-2124 fork hash (matching Go-Bor's gatherForks()), and configure Shanghai/Cancun/Prague as block-based forks (not timestamp-based, since Polygon is PoA).
  • Real Amoy genesis: Embed the complete genesis JSON with system contract alloc from Go-Bor to produce the correct genesis hash (0x7202b2b5...).

Test plan

  • All 55 bor-chainspec tests pass
  • Verified handshake + session establishment with all 4 official Amoy bootnodes
  • Genesis hash matches Go-Bor peers
  • Fork ID validated by remote peers (8b7e4175)
  • Non-Amoy peers correctly rejected (genesis mismatch)

🤖 Generated with Claude Code

…9 handshake

Three issues prevented connecting to Go-Bor Amoy peers:

1. Non-standard eth/69 Status: Go-Bor includes a TD field (8 fields)
   that standard eth/69 (EIP-7642) removed. Added BorRlpxHandshake
   that decodes both formats.

2. Fork ID mismatch: Go-Bor's internal gatherForks() only includes
   standard Ethereum forks in the EIP-2124 checksum, not Bor-specific
   forks. Also, Shanghai/Cancun/Prague are block-based on Polygon (not
   timestamp-based like mainnet Ethereum). Fixed eth_fork_blocks() to
   exclude Bor forks and configured post-merge forks as block-based.

3. Wrong genesis hash: Was using Genesis::default() instead of the real
   Amoy genesis with system contract alloc. Embedded the complete
   genesis JSON from Go-Bor to produce the correct state root.

Verified: all 4 Amoy bootnodes complete handshake and establish sessions.
@VAIBHAVJINDAL3012 VAIBHAVJINDAL3012 merged commit 49b61d9 into main Mar 12, 2026
2 of 3 checks passed
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.

1 participant