Skip to content

feat: Add Transaction Trace Monitoring Support#115

Merged
LeoGuo621 merged 10 commits intodevfrom
leo/add-tx-trace
Jan 26, 2026
Merged

feat: Add Transaction Trace Monitoring Support#115
LeoGuo621 merged 10 commits intodevfrom
leo/add-tx-trace

Conversation

@LeoGuo621
Copy link
Contributor

Description

Add transaction trace monitoring support with integration to xlayer-trace-monitor. Replaces --xlayer.full-link-monitor with --tx-trace.enable and --tx-trace.output-path flags. Adds --xlayer.sequencer-mode flag to control node mode for tracing. Implements transaction and block event logging in XLayerMonitor with proper process IDs based on sequencer/RPC mode.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Checklist

  • I have reviewed the relevant code guidelines in the docs/ folder
  • My code follows the coding standards of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Testing

  • Verified compilation with cargo check
  • Tested with --tx-trace.enable flag to ensure global tracer initializes correctly
  • Confirmed backward compatibility (tracing disabled by default)

Additional Notes

@LeoGuo621 LeoGuo621 changed the base branch from main to dev January 23, 2026 08:49
@LeoGuo621 LeoGuo621 requested review from JimmyShi22 and sieniven and removed request for JimmyShi22 January 23, 2026 08:54
// For X Layer full link monitor
let monitor =
XLayerMonitor::new(xlayer_args.monitor, args.node_args.flashblocks.enabled);
let monitor = XLayerMonitor::new(
Copy link
Contributor

Choose a reason for hiding this comment

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

This monitor initialization can also be controlled by tx_trace_enable flag

Copy link
Contributor

Choose a reason for hiding this comment

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

And also line 182 should be controlled by this flag

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've implemented the monitor.enable flag check internally within the components to keep main.rs clean:

  1. RpcMonitorLayer (rpc.rs): Checks enable flag in RpcMonitorService::call - passes through directly if disabled
  2. start_monitor_handle (handle.rs): Checks enable flag at function start - returns early if disabled

This approach avoids conditional branches in main.rs while ensuring no overhead when monitoring is disabled. The XLayerMonitor methods are already protected via get_global_tracer() which returns None when tracer isn't initialized.

@LeoGuo621 LeoGuo621 merged commit fa74608 into dev Jan 26, 2026
This was referenced Jan 28, 2026
louisliu2048 pushed a commit that referenced this pull request Feb 5, 2026
* upgrade to v1.10.0 (#98)

* perf(builder): use XLayerPayloadServiceBuilder to simplify main codes (#95)

Co-authored-by: Vui-Chee <vuicheesiew@gmail.com>
Co-authored-by: Niven <sieniven@gmail.com>

* drop unused dep

* chore: better rename, fix unused variable warning (#99)

* Better refactor, fix unused var warn

* Better rename

* Remove xlayer suffix

* Align cargo chef base image with latest rust toolchain version (#100)

* Update builder version (#101)

* feat(full trace): Add full trace hook framework (#103)

* add engine api hook for full trace

* rm comment

* fix clippy

* add send tx hook

* add blockchain tracer

* cargo lock

* fix review issues

* simplify to tracer to avoid nasty type bonanza

* renamed `TracerConfig` to `Tracer`

* more renames

* EngineApiTracer derive clone over manual impl

* handle middleware overwrite problem

* reorder

* drop clone

* no box on middleware rpc tracer

* impl `EngineApiBuilder` directly to tracer

---------

Co-authored-by: Vui-Chee <vuicheesiew@gmail.com>

* fix: remove engine api, and simplify monitor logic (#107)

* remove unused reth-node-api (#108)

* fix: resolve audit issues related to flashblocks subscription (#113)

* Fix unnecessary clone

* Fix incomplete documentation of subscribe addrs filter

* Better desc

* chore(flashblocks): update builder version to v0.2.5 (#114)

* Update builder version to v0.2.5 with full link monitor updates

* Fix wspub init

* feat: Add Transaction Trace Monitoring Support (#115)

* add trace logic

* optimize

* fix ut

* fix ut

* fix

* fix

* optimize code

* optimize code

* fix

* chore: fix rust formatter (#132)

* Fix fmt

* Remove unused dep

* Fix nested if else clippy check

* Update dependencies, use reth v1.10.2 and builder v0.3.0 (#133)

* fix: upgrade reth v1.10.2 version with bug fixes (#134)

* Fix revm dep

* Update reth version, use merge fixes version

* Add audit report (#135)

* add audit report

* add audit report

---------

Co-authored-by: chunsheng.wang <chunsheng.wang@okg.com>

* feat: add flashblocks enabled RPC method (#136)

* feat: add flashblocks enabled RPC method

* chore: clippy

* chore: add unit tests

* chore: reword documentation

* remove min gas rpc (#138)

---------

Co-authored-by: jimmyshi <417711026@qq.com>
Co-authored-by: Niven <sieniven@gmail.com>
Co-authored-by: Leo <335209779@qq.com>
Co-authored-by: wangchunsheng-ops <13614269216@163.com>
Co-authored-by: chunsheng.wang <chunsheng.wang@okg.com>
Co-authored-by: lucas <66681646+limyeechern@users.noreply.github.com>
louisliu2048 pushed a commit that referenced this pull request Feb 5, 2026
* upgrade to v1.10.0 (#98)

* perf(builder): use XLayerPayloadServiceBuilder to simplify main codes (#95)

Co-authored-by: Vui-Chee <vuicheesiew@gmail.com>
Co-authored-by: Niven <sieniven@gmail.com>

* drop unused dep

* chore: better rename, fix unused variable warning (#99)

* Better refactor, fix unused var warn

* Better rename

* Remove xlayer suffix

* Align cargo chef base image with latest rust toolchain version (#100)

* Update builder version (#101)

* feat(full trace): Add full trace hook framework (#103)

* add engine api hook for full trace

* rm comment

* fix clippy

* add send tx hook

* add blockchain tracer

* cargo lock

* fix review issues

* simplify to tracer to avoid nasty type bonanza

* renamed `TracerConfig` to `Tracer`

* more renames

* EngineApiTracer derive clone over manual impl

* handle middleware overwrite problem

* reorder

* drop clone

* no box on middleware rpc tracer

* impl `EngineApiBuilder` directly to tracer

---------

Co-authored-by: Vui-Chee <vuicheesiew@gmail.com>

* fix: remove engine api, and simplify monitor logic (#107)

* remove unused reth-node-api (#108)

* fix: resolve audit issues related to flashblocks subscription (#113)

* Fix unnecessary clone

* Fix incomplete documentation of subscribe addrs filter

* Better desc

* chore(flashblocks): update builder version to v0.2.5 (#114)

* Update builder version to v0.2.5 with full link monitor updates

* Fix wspub init

* feat: Add Transaction Trace Monitoring Support (#115)

* add trace logic

* optimize

* fix ut

* fix ut

* fix

* fix

* optimize code

* optimize code

* fix

* chore: fix rust formatter (#132)

* Fix fmt

* Remove unused dep

* Fix nested if else clippy check

* Update dependencies, use reth v1.10.2 and builder v0.3.0 (#133)

* fix: upgrade reth v1.10.2 version with bug fixes (#134)

* Fix revm dep

* Update reth version, use merge fixes version

* Add audit report (#135)

* add audit report

* add audit report

---------

Co-authored-by: chunsheng.wang <chunsheng.wang@okg.com>

* feat: add flashblocks enabled RPC method (#136)

* feat: add flashblocks enabled RPC method

* chore: clippy

* chore: add unit tests

* chore: reword documentation

* remove min gas rpc (#138)

---------

Co-authored-by: jimmyshi <417711026@qq.com>
Co-authored-by: Niven <sieniven@gmail.com>
Co-authored-by: Leo <335209779@qq.com>
Co-authored-by: wangchunsheng-ops <13614269216@163.com>
Co-authored-by: chunsheng.wang <chunsheng.wang@okg.com>
Co-authored-by: lucas <66681646+limyeechern@users.noreply.github.com>
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.

3 participants