Skip to content

refactor: wallet on_new_tx#1561

Merged
glevco merged 4 commits intomasterfrom
refactor/wallet-on-new-tx
Jan 28, 2026
Merged

refactor: wallet on_new_tx#1561
glevco merged 4 commits intomasterfrom
refactor/wallet-on-new-tx

Conversation

@glevco
Copy link
Contributor

@glevco glevco commented Jan 21, 2026

Depends on #1547

Motivation

There's a long-standing TODO on the VertexHandler to make the wallet processing of new txs asynchronous, via PubSub. This PR does this. I had to introduce a new event type to fire before the consensus, because the wallet expected its on_new_tx method to be called before all other asynchronous events the consensus emits.

Acceptance Criteria

  • Add new pubsub event NETWORK_NEW_TX_PROCESSING.
  • Refactor wallet on the VertexHandler so it handles NETWORK_NEW_TX_PROCESSING events asynchronously, instead of a synchronous call to wallet.on_new_tx().
  • Fix tests.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@glevco glevco self-assigned this Jan 21, 2026
@glevco glevco removed the status in Hathor Network Jan 21, 2026
@glevco glevco moved this to Todo in Hathor Network Jan 21, 2026
@glevco glevco force-pushed the refactor/wallet-on-new-tx branch from c66ad17 to eaef7cd Compare January 21, 2026 02:42
@glevco glevco moved this from Todo to In Progress (WIP) in Hathor Network Jan 21, 2026
@glevco glevco force-pushed the refactor/wallet-on-new-tx branch from eaef7cd to e0a08c0 Compare January 21, 2026 03:33
@glevco glevco moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Jan 21, 2026
@glevco glevco force-pushed the feat/critical-indexes branch from 452fd4a to 2199ef8 Compare January 21, 2026 13:34
@glevco glevco moved this from In Progress (Done) to In Progress (WIP) in Hathor Network Jan 21, 2026
@glevco glevco force-pushed the refactor/wallet-on-new-tx branch from e0a08c0 to 38ae478 Compare January 21, 2026 13:39
@glevco glevco moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Jan 21, 2026
@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.71%. Comparing base (bc7b56b) to head (0e8fa62).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1561      +/-   ##
==========================================
- Coverage   85.85%   85.71%   -0.15%     
==========================================
  Files         439      439              
  Lines       33758    33767       +9     
  Branches     5276     5277       +1     
==========================================
- Hits        28984    28944      -40     
- Misses       3773     3805      +32     
- Partials     1001     1018      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@glevco glevco force-pushed the refactor/wallet-on-new-tx branch from 38ae478 to 6fc3b8b Compare January 21, 2026 14:19
@github-project-automation github-project-automation bot moved this from In Progress (Done) to In Review (WIP) in Hathor Network Jan 21, 2026
@glevco glevco force-pushed the feat/critical-indexes branch 2 times, most recently from 00e1894 to 945a67f Compare January 21, 2026 17:15
Base automatically changed from feat/critical-indexes to master January 21, 2026 20:55
@glevco glevco force-pushed the refactor/wallet-on-new-tx branch from 6fc3b8b to 6bf9bd3 Compare January 22, 2026 13:28
@github-actions
Copy link

github-actions bot commented Jan 22, 2026

🐰 Bencher Report

Branchrefactor/wallet-on-new-tx
Testbedubuntu-22.04
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
minutes (m)
(Result Δ%)
Lower Boundary
minutes (m)
(Limit %)
Upper Boundary
minutes (m)
(Limit %)
sync-v2 (up to 20000 blocks)📈 view plot
🚷 view threshold
1.70 m
(-1.13%)Baseline: 1.71 m
1.54 m
(91.03%)
2.06 m
(82.39%)
🐰 View full continuous benchmarking report in Bencher

@glevco glevco force-pushed the refactor/wallet-on-new-tx branch 4 times, most recently from dae0a35 to deb4dca Compare January 27, 2026 23:55
@glevco glevco force-pushed the refactor/wallet-on-new-tx branch from deb4dca to 0e8fa62 Compare January 27, 2026 23:56
@glevco glevco merged commit 810be9a into master Jan 28, 2026
21 of 22 checks passed
@glevco glevco deleted the refactor/wallet-on-new-tx branch January 28, 2026 19:33
@github-project-automation github-project-automation bot moved this from In Review (WIP) to Waiting to be deployed in Hathor Network Jan 28, 2026
@jansegre jansegre mentioned this pull request Jan 28, 2026
2 tasks
r4mmer added a commit that referenced this pull request Jan 29, 2026
* origin/master:
  chore: configure feature activations for v0.69.0 release
  refactor: wallet on_new_tx (#1561)
  refactor(nano): Remove dead reorg cleanup code from block executor
  feat(script): deprecate unnecessary opcodes
  test: Fix flaky tests
  refactor(nano): Refactor to facilitate dry runnning blocks and transactions
  feat(nano): add support for json_dumps (#1572)
  refactor(nano): Move the nano execution logic to a separate file
jansegre pushed a commit that referenced this pull request Jan 30, 2026
@jansegre jansegre mentioned this pull request Jan 30, 2026
2 tasks
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Feb 4, 2026
r4mmer added a commit that referenced this pull request Feb 19, 2026
…ntic-settings

* origin/master:
  chore: adjust testnet config for v0.69.0 release
  chore: configure feature activations for v0.69.0 release
  refactor: wallet on_new_tx (#1561)
  refactor(nano): Remove dead reorg cleanup code from block executor
r4mmer added a commit that referenced this pull request Feb 24, 2026
…print-move-1

* origin/master:
  feat: pydantic settings (#1600)
  fix[thin_wallet]: handle address history invalid tx version (#1590)
  refactor(nano): Make NCBlockExecutor a pure executor with no side effects
  fix[nginx]: Make sure we trust the GCP IPs to get the real client IP (#1595)
  refactor: Upgrade to Pydantic v2
  chore(github): Split GitHub main action into lint, test-cli, test-lib, test-other
  fix[nginx]: Use a larger buffer size for /v1a/status (#1594)
  chore: adjust testnet config for v0.69.0 release
  chore[storage]: Limit the total size of RocksDB WAL files (#1518)
  chore: adjust testnet config for v0.69.0 release
  chore: configure feature activations for v0.69.0 release
  refactor: wallet on_new_tx (#1561)
  refactor(nano): Remove dead reorg cleanup code from block executor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants