Commit cde7f9f
authored
fix(consensus)!: refactor execution fork handling, better finalization perf (tari-project#1425)
Description
---
fix(consensus)!: refactor execution fork handling, better finalization
perf
Motivation and Context
---
Finalizing big blocks (>2000 finalizing txs) would take around a minute
in tests. This PR reduces this to < 10s for similar payloads.
The finalizing step simply inserts the transaction ID into an index to
mark it as finalized.
How Has This Been Tested?
---
Manually
What process can a PR reviewer use to test or verify this change?
---
Works as before
Breaking Changes
---
- [ ] None
- [x] Requires data directory to be deleted
- [ ] Other - Please specify
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Added grouping support for databases and shard group display in the
database inspector UI.
- Introduced explicit transaction execution querying, locking, and
finalization methods in storage layers.
- Added new transaction validation result struct to clarify sequencing
logic.
- Added TypeScript interfaces for new account info and wallet
transaction types.
- **Improvements**
- Consolidated and simplified transaction and execution data models,
removing legacy fields and unifying execution handling.
- Enhanced consensus and transaction pool logic for clearer transaction
sequencing, validation, and execution preparation.
- Streamlined abort reason handling with a refined and reduced set of
abort causes.
- Centralized leader fee calculation logic for consistency.
- Updated transaction execution and block execution models to use richer
block and transaction identifiers.
- Improved error handling and logging in consensus and transaction
processing flows.
- Refined transaction finalization and decision assertions in tests.
- Replaced explicit unwraps with safer access patterns in transaction
result handling.
- Replaced `chrono` with `time` crate for timestamp handling across
storage and template management modules.
- Updated web UI and RPC handlers to reflect new transaction execution
data structures.
- Simplified transaction handling by removing legacy executed
transaction abstractions.
- Added utility functions for current timestamp retrieval and
encoding/decoding of datetime values.
- Fixed template selection logic for swap and faucet templates in the
tariswap test bench.
- Improved transaction pool insertion to accept explicit decision
parameters.
- Refined leader timeout suspension handling in consensus proposal
processing.
- Updated consensus no-vote handling to propagate detailed reasons.
- Enhanced transaction pool insertion to accept explicit decision
parameters.
- Adjusted transaction execution and block transaction execution models
to explicitly store leaf blocks and transaction IDs.
- Consolidated transaction execution retrieval and finalization logic in
storage layers.
- Simplified transaction record by removing execution and finalization
fields, delegating to storage queries.
- Updated CLI, bindings, and clients to align with new transaction
execution APIs and data structures.
- Improved internal documentation and code comments for clarity.
- **Bug Fixes**
- Removed duplicate transaction input validation during validator node
bootstrap.
- **Refactor**
- Standardized transaction execution method signatures and storage keys,
adopting richer block and transaction identifiers.
- Updated test harnesses, CLI tools, and bindings to align with new
transaction execution APIs and data structures.
- Removed SQL-related configuration and code from consensus test
builders and validators.
- Modularized transaction preparation logic by input type and improved
lock acquisition strategies.
- Refactored consensus transaction manager and HotStuff logic to unify
transaction record handling.
- Cleaned up abort handling and removed redundant methods from
transaction and execution models.
- Reorganized database column families and queries to include block
height and improve indexing.
- Simplified and unified deserialization and serialization logic in
wallet storage.
- Removed executed transaction module and related legacy abstractions.
- Renamed pacemaker failure suspension methods to timeout suspension for
clarity.
- Added TypeScript bindings for new types and updated existing bindings
to match data model changes.
- **Chores**
- Removed unused dependencies including `chrono` and `strum_macros`.
- Updated package scripts to separate formatting and build steps.
- Cleaned up legacy code paths and imports.
- Removed SQL database configuration from consensus test builders and
validators.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 10e68de commit cde7f9f
File tree
132 files changed
+2709
-2436
lines changed- applications
- tari_dan_app_utilities/src
- tari_dan_wallet_daemon
- src/handlers
- web_ui/src/routes/Transactions
- tari_indexer/src
- dry_run
- json_rpc
- tari_validator_node_cli/src/command
- tari_validator_node
- src
- consensus
- json_rpc
- p2p
- rpc
- services/mempool
- web_ui/src/routes/Transactions
- bindings
- src
- types
- tari-indexer-client
- validator-node-client
- wallet-daemon-client
- clients
- javascript/wallet_daemon_client/src
- tari_indexer_client/src
- validator_node_client/src
- wallet_daemon_client
- src
- dan_layer
- common_types/src
- consensus_tests/src
- support
- validator
- consensus/src
- hotstuff
- transaction_manager
- traits
- engine_types/src
- p2p
- proto
- src/conversions
- state_store_rocksdb/src
- codecs
- models
- state_store_tests/src
- storage_sqlite
- src/global/models
- storage
- src
- consensus_models
- global
- state_store
- template_manager
- src/implementation
- transaction/src
- validator_node_rpc/src
- wallet
- sdk
- src
- models
- storage_sqlite
- migrations/2023-02-08-122514_initial
- src
- models
- integration_tests/tests
- utilities
- db_inspector
- src
- webserver
- handlers
- web_ui/src
- components
- routes
- store
- tariswap_test_bench
- src
- transaction_submitter/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
132 files changed
+2709
-2436
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| |||
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
109 | | - | |
| 108 | + | |
110 | 109 | | |
111 | 110 | | |
112 | 111 | | |
| |||
136 | 135 | | |
137 | 136 | | |
138 | 137 | | |
139 | | - | |
| 138 | + | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
| |||
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
| 375 | + | |
381 | 376 | | |
382 | 377 | | |
383 | 378 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
Lines changed: 7 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 43 | + | |
51 | 44 | | |
52 | 45 | | |
53 | 46 | | |
| |||
77 | 70 | | |
78 | 71 | | |
79 | 72 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
86 | 79 | | |
87 | 80 | | |
88 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
450 | 454 | | |
451 | 455 | | |
452 | 456 | | |
453 | | - | |
| 457 | + | |
454 | 458 | | |
455 | 459 | | |
456 | 460 | | |
| |||
675 | 679 | | |
676 | 680 | | |
677 | 681 | | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
510 | 509 | | |
511 | 510 | | |
512 | 511 | | |
| |||
Lines changed: 28 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | | - | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | | - | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
104 | 125 | | |
105 | 126 | | |
106 | 127 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
0 commit comments