Charging Users and Value Reconciliation #118
Replies: 3 comments 2 replies
-
Steps to play in an Ephem Validator
Nuances around 2.A program can decide how an escrow can be created to play inside a specific validator/program.
For NOTE: this requires that the undelegation goes through the developer's program, i.e. via a CPI |
Beta Was this translation helpful? Give feedback.
-
My thoughts on the proposed approaches: NoteAll the above scenario only solve 1 problem: Scenario 1In this scenario, the lamports never "exit" the validator. I believe this is a huge problem that will have many foreseen and unforseen consequences. Example where that would be a problem: Vincent sends lamports to Gabriele in exchange for Ammunition:
- The ammunition can exit the validator
- But the lamports cannot
- Therefore I can print ammunition infinitely without incuring any cost We could "maybe?" still make this work with figuring out who's gonna pay for resize and commits while forcing everything to NOT use lamports somehow but at a very high complexity cost that is sub-optimal in my opinion. Scenario 2First of all quick note that I don't think that lamports should be set when the account is commited, any lamport reconcilation should happen at finalize/undelegate time IMO. That would be dangerous because:
I don't understand the difference between scenario 2 and 3, is the only difference that the resize/commits is being paid by a central "Bank" account? Scenario 3This is in my opinion the most realistic and feasible option. I would describe this implementation as "lamports in the validator are real lamports" because:
This case is superior because it covers all other usecases:
|
Beta Was this translation helpful? Give feedback.
-
Closing and continuing in #122 |
Beta Was this translation helpful? Give feedback.
-
Initial Design for Charging Users and Value Reconciliation
Requirements
We need to:
Problems
To provide context, these are some use cases we should consider while designing a solution. Ideally, we should support all of them:
fees - (costs of infra + commits + security committee + DA)
.octane
: Octane GitHub.Scenario 1
Assumptions
Possible ways to make someone else pay and prevent any extractive behavior from an attacker targeting the validator keypair:
FeeSpace
PDA for each program/ER session to pay the lamports difference to make it rent-exempt. Developers could top up theFeeSpace
and set up instructions so that whenever a resize occurs, theFeeSpace
has enough lamports; otherwise, the finalization will fail (developers know when an account will increase in size and can decide who pays for it).Description
If the assumptions hold, point 2 in the requirements is addressed, and we can focus on implementing a solution for charging users for compute.
Proposed Solution for Charging Users
FeeVault
PDA, which is a PDA of thedelegation program
. TheFeeVault
PDA holds SPL tokens.(mint_fee_token, ratio to lamports)
.RequestFees
to charge users. This instruction could be part of thedelegation_program
and would transfer tokens from theFeeVault
PDA to the validator's identity keypair (on the base layer) once approved. Thecharge amount
is determined using the pricing function. This could be associated with acommit record
and approved by the committee along with the state.Notes:
system_program
owned accounts with1000 - current lamports
).Scenario 2
Assumptions
original_account
.system_owned
accounts can never increase the lamports in the ER.initial lamports
balance is projected from aFeeVault
PDA (instead of the current 1000 initial value).Notes
Proposed Solution for Value Reconciliation
lamports = 100
→commit(a): lamports = 150
Bank PDA
toA
.lamports = 100
→commit(a): lamports = 50
A
toBank PDA
.Proposed Solution for Charging Users
Bank PDA
.Scenario 3
Assumptions
original_account
.initial lamports
balance is projected from aFeeVault
PDA (instead of the current 1000 initial value).Notes
Proposed Solution for Charging Users
Proposed Solution for Value Reconciliation
Beta Was this translation helpful? Give feedback.
All reactions