-
Notifications
You must be signed in to change notification settings - Fork 28
feat: fees parameters backend #1268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThis set of changes replaces the static Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant ProtocolRPC
participant TransactionsProcessor
participant Database
participant Consensus
participant Node
Client->>ProtocolRPC: send_raw_transaction(data, ...)
ProtocolRPC->>TransactionsProcessor: insert_transaction(..., fees_distribution, ...)
TransactionsProcessor->>Database: Store transaction with fees_distribution, appeal_count=0
loop Consensus process
Consensus->>Node: Create Node(timeout from fees_distribution)
Node->>Node: run_contract(..., timeout)
end
TransactionsProcessor->>Consensus: Use fees_distribution/appeal_count for rotations/appeals
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…on when appeal round fee is exhausted
|
| - transaction_data["rotation_count"] | ||
| ) | ||
|
|
||
| if transaction_data["fees_distribution"] is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kstroobants these two if statements withing 10 lines seems weird.


Fixes #DXP-442
What
VITE_MAX_ROTATIONSfrom.env.example.timeoutparameter toNodeFactory.NodeandGenVMHostclasses to includetimeouthandling.rotation_countfromTransactionContextinbackend/consensus/base.pybecause transaction receipt needs access to it.config_rotation_rounds.fees_distributionandappeal_countto theTransactionsmodel inbackend/database_handler/models.py.d30f826417f1_add_fees_distribution.pyto addfees_distributionandappeal_countcolumns and removeconfig_rotation_rounds.SnapshotManagerandTransactionsProcessorto handle new fields and logic.Why
Testing done
Decisions made
VITE_MAX_ROTATIONSas it was no longer needed.Checks
Reviewing tips
Focus on the changes.
Depends
It needs genlayer-js implementation of the fees to know how to decode the parameters. For now they are hardcoded in
endpoints.py.User facing release notes
Added support for fees distribution.
Summary by CodeRabbit
New Features
fees_distributionstructure.Improvements
Bug Fixes
Chores