Skip to content

Feat/live tracer support#2043

Draft
milando12 wants to merge 5 commits into0xPolygon:developfrom
milando12:md/feat-live-tracer
Draft

Feat/live tracer support#2043
milando12 wants to merge 5 commits into0xPolygon:developfrom
milando12:md/feat-live-tracer

Conversation

@milando12
Copy link

Description

Adds Live Tracer support for bor server

Changes

  • New feature (non-breaking change that adds functionality)

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • Created a task in Jira and informed the team for implementation in Erigon client (if applicable)

Cross repository changes

  • This PR requires changes to heimdall
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on amoy
  • I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

- Introduced `vm.Config` to multiple functions for customizable VM tracing.
- Added tracer configuration flags (`vmtrace` and `vmtrace.jsonconfig`) to streamline monitoring during blockchain synchronization.
- Updated GenesisContract and spanner interfaces for trace integration.
- Integrated tracing hooks for StateSyncTx events.
@milando12 milando12 marked this pull request as draft February 6, 2026 08:52
Remove the 4 [DEBUG] log lines that were added during development
to diagnose StateSyncTx tracing issues.
When Finalize is called, the chain parameter can be a *core.HeaderChain
(not just *core.BlockChain). Without this change, the tracer in vmCfg
is nil during finalization, so StateSyncTx tracing hooks never fire.

- Add vmConfig field and GetVMConfig() method to HeaderChain
- Set hc.vmConfig in NewBlockChain after creating the HeaderChain
- Add else-if branch in Finalize and FinalizeAndAssemble to extract
  VM config from HeaderChain
The Process function creates a tracingStateDB wrapper for tracing but
was passing the unwrapped statedb to Finalize, causing the tracer to
miss StateSyncTx state changes.
@sonarqubecloud
Copy link

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