Skip to content

feat(dynamic-transaction-model): fee verification using fee header and nc#1415

Merged
jansegre merged 1 commit intomasterfrom
raul-oliveira/fee-token-verification
Oct 15, 2025
Merged

feat(dynamic-transaction-model): fee verification using fee header and nc#1415
jansegre merged 1 commit intomasterfrom
raul-oliveira/fee-token-verification

Conversation

@raul-oliveira
Copy link
Contributor

@raul-oliveira raul-oliveira commented Sep 17, 2025

Depends on 1414

Motivation

To make fee payment explicit in the transaction this pr adds the FeeHeader in the transaction. It carries all the tokens and amounts, indicating they will be used to pay fees.

Acceptance Criteria

  • Should use the FeeHeader to manipulate the token_dict to make fees act as outputs in the diff.
  • The verify_sum will have a flag to indicate if it should enforce the HTR amount validation or not. This flag is useful when dealing with nano contracts that might have tokens that aren't created at the verification stage.
  • Add a verify_sum call when the nano contract executes in the block_consensus
  • Adds the fee_header verification without storage whithin the basic verification
  • Specify the block to be used and the source of data in the methods that calls on_old_new_vertex
  • Change the VerificationParams to receive a block or block storage

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

@jansegre jansegre mentioned this pull request Sep 17, 2025
2 tasks
@msbrogli msbrogli moved this to In Progress (WIP) in Hathor Network Sep 17, 2025
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-verification branch from 9bbd517 to 792c71f Compare September 19, 2025 00:30
@github-actions
Copy link

github-actions bot commented Sep 19, 2025

🐰 Bencher Report

Branchraul-oliveira/fee-token-verification
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.95 m
(+12.31%)Baseline: 1.73 m
1.56 m
(80.14%)
2.08 m
(93.59%)
🐰 View full continuous benchmarking report in Bencher

@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-verification branch from 792c71f to 57bc472 Compare September 19, 2025 13:11
@codecov
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

❌ Patch coverage is 94.97207% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.10%. Comparing base (aa3ff28) to head (dca477b).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
hathor/wallet/resources/thin_wallet/send_tokens.py 50.00% 3 Missing ⚠️
hathor/nanocontracts/balance_rules.py 77.77% 1 Missing and 1 partial ⚠️
hathor/transaction/transaction.py 92.85% 1 Missing and 1 partial ⚠️
hathor/verification/transaction_verifier.py 94.28% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1415      +/-   ##
==========================================
- Coverage   86.11%   86.10%   -0.01%     
==========================================
  Files         435      436       +1     
  Lines       33940    34024      +84     
  Branches     5302     5319      +17     
==========================================
+ Hits        29227    29298      +71     
- Misses       3675     3681       +6     
- Partials     1038     1045       +7     

☔ 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.

@raul-oliveira raul-oliveira force-pushed the raul-oliveira/fee-token-verification branch 2 times, most recently from 5f75b8f to 62aef14 Compare September 19, 2025 18:32
@raul-oliveira raul-oliveira marked this pull request as ready for review September 19, 2025 23:22
@raul-oliveira raul-oliveira changed the base branch from master to feat/fee-header-dag-builder September 19, 2025 23:23
@raul-oliveira raul-oliveira moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Sep 29, 2025
@raul-oliveira raul-oliveira moved this from In Progress (Done) to In Review (WIP) in Hathor Network Sep 29, 2025
@raul-oliveira raul-oliveira force-pushed the feat/fee-header-dag-builder branch 2 times, most recently from 4c51478 to 8d62cf4 Compare October 1, 2025 21:47
@glevco glevco force-pushed the feat/fee-header-dag-builder branch 7 times, most recently from d07267e to fa6ca38 Compare October 2, 2025 20:53
@glevco glevco force-pushed the raul-oliveira/fee-token-verification branch 2 times, most recently from 7f0a436 to dd284fc Compare October 2, 2025 21:04
@glevco glevco force-pushed the raul-oliveira/fee-token-verification branch from fbb6da8 to 35916b0 Compare October 8, 2025 21:59
@glevco glevco force-pushed the raul-oliveira/fee-token-verification branch 4 times, most recently from 628d92d to 79a7653 Compare October 9, 2025 22:05
@glevco glevco force-pushed the raul-oliveira/fee-token-verification branch from 3bed28d to 4b5a0f5 Compare October 10, 2025 04:27
@glevco glevco force-pushed the raul-oliveira/fee-token-verification branch 4 times, most recently from 449847a to 75d0278 Compare October 13, 2025 16:03
jansegre
jansegre previously approved these changes Oct 13, 2025
@glevco glevco force-pushed the raul-oliveira/fee-token-verification branch from 75d0278 to ecacbad Compare October 13, 2025 21:49
@glevco glevco force-pushed the raul-oliveira/fee-token-verification branch from ecacbad to c92032e Compare October 14, 2025 22:06
@glevco glevco force-pushed the raul-oliveira/fee-token-verification branch from fbc7ceb to 72e231a Compare October 15, 2025 15:54
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Oct 15, 2025
@github-project-automation github-project-automation bot moved this from In Review (Done) to In Review (WIP) in Hathor Network Oct 15, 2025
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Oct 15, 2025
Co-authored-by: raul-oliveira <mrraul65@gmail.com>
@glevco glevco force-pushed the raul-oliveira/fee-token-verification branch from 72e231a to dca477b Compare October 15, 2025 16:32
@jansegre jansegre merged commit 2cc42d6 into master Oct 15, 2025
5 of 8 checks passed
@jansegre jansegre mentioned this pull request Oct 16, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants