refactor(runtime): use lamports per signature constant - #1732
refactor(runtime): use lamports per signature constant#1732leviathanbeak wants to merge 7 commits into
Conversation
c4cfbae to
d205d4f
Compare
|
I'm reopening the other one to keep the discussion history unified |
|
never mind, github won't allow it because the branch was force pushed or recreated |
There was a problem hiding this comment.
Pull request overview
This PR refactors fee handling by introducing a shared LAMPORTS_PER_SIGNATURE constant in the runtime fee-check logic and replacing several hard-coded 5000 usages with that constant (or with a derived lamports-per-signature value where already available), while also simplifying SvmGateway initialization by removing a now-unneeded lamports_per_signature init parameter.
Changes:
- Add
sig.runtime.check_transactions.LAMPORTS_PER_SIGNATUREand use it in runtime execution/tests and mock transfer logic. - Remove
lamports_per_signaturefromSvmGateway.Paramsand update all init call sites accordingly. - Update fee computation in RPC
getFeeForMessageto use the blockhash-queue-derived lamports-per-signature instead of a hard-coded value.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/transaction_sender/MockTransferService.zig | Replace hard-coded transfer fee with runtime LAMPORTS_PER_SIGNATURE. |
| src/rpc/hook_contexts/SendTransaction.zig | Update SvmGateway.init call after removing lamports_per_signature param. |
| src/rpc/hook_contexts/Account.zig | Use bq_lps (blockhash queue lamports-per-signature) when computing FeeDetails. |
| src/replay/svm_gateway.zig | Remove lamports_per_signature from gateway params; set env fee rate from runtime constant. |
| src/replay/execution.zig | Update replay/test scaffolding to match new SvmGateway.Params. |
| shared/runtime/transaction_execution.zig | Thread lamports-per-signature into fee payer checking; update tests to use constant. |
| shared/runtime/check_transactions.zig | Add LAMPORTS_PER_SIGNATURE constant; accept lamports_per_signature as an input to fee payer checks; update tests. |
| conformance/src/txn_execute.zig | Use runtime constant for transaction execution environment fee configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .last_lamports_per_signature = last_lamports_per_signature, | ||
|
|
||
| .lamports_per_signature = self.params.lamports_per_signature, | ||
| .lamports_per_signature = sig.runtime.check_transactions.LAMPORTS_PER_SIGNATURE, |
| .next_lamports_per_signature = last_lamports_per_signature, | ||
| .last_lamports_per_signature = last_lamports_per_signature, | ||
| .lamports_per_signature = 5000, | ||
| .lamports_per_signature = sig.runtime.check_transactions.LAMPORTS_PER_SIGNATURE, |
| &compute_budget_limits, | ||
| maybe_nonce_info, | ||
| env.rent_collector, | ||
| env.lamports_per_signature, | ||
| )) { |
7b2b123 to
c7d526e
Compare
|
Hey @leviathanbeak, any thoughts on this feedback from the original PR? #1586 (review)
Also it looks like you have some ci failures. |
thanks @dnut , I think everything from original comment is resolved now, will check if there are further CI issues related to this PR |
460fa89 to
b93ecff
Compare
|
So given the feedback on the closed PR, all in all this PR
|
|
the files were moved so you'll need to resolve the conflicts before we can merge this |
25021a0 to
cb772ef
Compare
@dnut done |
reopening #1586
I missed the notification for #1586, here's the updated version (didn't have the privileges to reopen the closed one directly)
thanks, for the review