solana-labs / solana

Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces.
https://solanalabs.com
Apache License 2.0
13.02k stars 4.19k forks source link

Demo request: leader pays for transaction fee #7836

Closed aeyakovenko closed 3 years ago

aeyakovenko commented 4 years ago

Problem

With Nonce accounts clients can sign a transaction that is executed once and which results in a deposit into the spending account.

This means that clients can propose transactions that can be payed for once and only once by any leader that is willing to include it in a block. The leader can compute the “tip”, the difference between the deposit and the fee, and sign the transaction if the tip is high enough.

Proposed Solution

Implement the demo and documentation for the sdk.

Additional changes to the runtime are necessary for the leader to have a guarantee that the transaction is encoded iff it is successful. This could be implemented as an error code for any transaction that fail if they are signed by the leader in the banking stage. The banking stage would drop transactions with that error code.

Even though this requires the leader to precompute the state before including the transaction, it wont interfere with the bankless leader design.

tag: @garious @t-nelson @jackcmay @jstarry @CriesofCarrots @mvines @rob-solana

garious commented 4 years ago

The problem isn't clear to me. Why do you want the leader to pay the fee? Maybe the deposit is not a native token?

aeyakovenko commented 4 years ago

@garious Correct, that’s the primary usecase I am thinking of.

Users that hold a Solana DAI can pay for the transaction in DAI to the leader.

aeyakovenko commented 4 years ago

Hmm, won’t work yet. The user needs to sign of on the DAI transfer prior to knowing the leaders pubkey. So we need signatures that cover parts of the transaction

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 3 years ago

This stale issue has been automatically closed. Thank you for your contributions.