Skip to content

Deterministic state sync#145

Merged
marcello33 merged 17 commits into
release/3.2-developfrom
mardizzone/POS-3441_deterministic-ss
May 19, 2026
Merged

Deterministic state sync#145
marcello33 merged 17 commits into
release/3.2-developfrom
mardizzone/POS-3441_deterministic-ss

Conversation

@marcello33

@marcello33 marcello33 commented Mar 31, 2026

Copy link
Copy Markdown

Summary

Implements the erigon side of deterministic state syncs for Polygon PoS.

Cross-repository changes

@marcello33

Copy link
Copy Markdown
Author

@claude review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Bor fork point to enable “deterministic state sync” behavior, switching bridge event-range resolution to Heimdall V2 height-based queries after the configured activation block.

Changes:

  • Introduces deterministicStateSyncBlock to Bor config/chainspecs and wires it through chain config + fork ID gathering.
  • Extends the bridge Heimdall client/service to resolve a deterministic end event ID via block-height-by-time + state-syncs-at-height.
  • Adds bridge unit tests covering the deterministic path and key error/validation cases.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
polygon/chain/chainspecs/bor-devnet.json Enables deterministic state sync fork on bor-devnet at block 500.
polygon/bridge/service.go Implements deterministic event range resolution and adds waitForScraperByEventId.
polygon/bridge/service_test.go Adds tests for deterministic state sync behavior and error handling.
polygon/bridge/event_record.go Adds Heimdall V2 response type for block height-by-time.
polygon/bridge/client.go Extends bridge client interface with deterministic state sync endpoints.
polygon/bridge/client_mock.go Regenerates mocks for the extended client interface.
polygon/bridge/client_idle.go Adds explicit errors for deterministic-only methods on IdleClient.
polygon/bridge/client_http.go Implements Heimdall V2 HTTP calls for height lookup and at-height event fetching.
polygon/bor/borcfg/bor_config.go Adds deterministic fork config field + accessors.
p2p/forkid/forkid.go Includes Giugliano + deterministic state sync blocks in fork ID inputs.
p2p/forkid/forkid_test.go Updates expected fork IDs for Polygon specs given added forks.
execution/chain/chain_config.go Extends BorConfig interface + prints deterministic fork in config string.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread polygon/bridge/service.go Outdated
Comment thread polygon/bridge/service.go Outdated
Comment thread polygon/bridge/service.go Outdated
Comment thread polygon/bor/borcfg/bor_config.go Outdated
@marcello33 marcello33 requested a review from a team April 2, 2026 06:15
@marcello33 marcello33 merged commit f07dc7e into release/3.2-develop May 19, 2026
12 of 15 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.

4 participants