Skip to content

Conversation

@Officeyutong
Copy link
Collaborator

@Officeyutong Officeyutong commented Apr 10, 2025

This PR adds min fee check and DAO script size check when sending transactions through light client

  • Every transactions submited to a light client by send_transaction will get their fee rate calculated, and compared to a pre-set fixed fee rate (1000 shannon per kilobytes). Transactions with insufficient fee rate will be rejected by send_transaction.
  • Also, every transactions will be checked by DaoScriptSizeVerifier.

@Officeyutong Officeyutong requested a review from Copilot April 10, 2025 17:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

light-client-lib/src/verify.rs:254

  • [nitpick] Consider using an explicit conversion method instead of relying on into() here so that the intended type conversion for swc is clearer and more readable.
swc.clone().into(),

light-client-lib/src/tests/verify.rs:43

  • Consider adding a test case to verify the error path when the transaction fee is below the minimum fee rate, ensuring that MinFeeVerifier::verify returns an appropriate error.
assert_eq!(fee_calculator.transaction_fee(&rtx).unwrap(), Capacity::shannons(1_0000_0000));

@codecov-commenter
Copy link

codecov-commenter commented Apr 10, 2025

Codecov Report

Attention: Patch coverage is 88.63636% with 5 lines in your changes missing coverage. Please review.

Project coverage is 71.90%. Comparing base (c92f3ac) to head (e1315ed).
Report is 6 commits behind head on develop.

Files with missing lines Patch % Lines
light-client-lib/src/verify.rs 88.63% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #216      +/-   ##
===========================================
+ Coverage    71.58%   71.90%   +0.32%     
===========================================
  Files           27       27              
  Lines         6925     6966      +41     
===========================================
+ Hits          4957     5009      +52     
+ Misses        1968     1957      -11     
Flag Coverage Δ
unittests 71.90% <88.63%> (+0.32%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Officeyutong Officeyutong marked this pull request as ready for review April 11, 2025 11:52
@Officeyutong Officeyutong requested a review from quake April 11, 2025 11:52
@Officeyutong Officeyutong marked this pull request as draft May 28, 2025 07:07
@Officeyutong Officeyutong marked this pull request as ready for review June 12, 2025 09:52
@Officeyutong Officeyutong changed the title feat: add min fee rate check when sending transactions feat: Integrate MinFeeVerifier and DaoScriptSizeVerifier into light-client Jun 12, 2025
@quake quake merged commit b6cda59 into develop Jun 13, 2025
7 checks passed
@quake quake deleted the update-fee-rate-checker branch June 18, 2025 07:05
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.

4 participants