Create and deploy fee collector accounts - #2568
Mirko-von-Leipzig wants to merge 3 commits into
Conversation
30737c0 to
4c39055
Compare
|
Question: Why do we need commands for deploying the fee collector account? Is this done manually or by some script? I expected the deployment to be handled automatically as part of batch building, as part of the first batch. So the first batch would contain the deploy + fee collection tx (could be the same tx, simpler for the tx creators) and after that only one fee collection tx per batch. |
4c39055 to
7bedab6
Compare
Because the first transaction changes the accounts state by deploying it. So there is no way to spin up multiple concurrent batch building threads without racing them. You first need a sequentially ordered batch. I opted to implement that as a separate step completely because otherwise its too much effort to handle failures, rollbacks etc. Really we should just deploy this in genesis, but whatever :) This would be done by whoever is operating the sequencer, so however they wish to do it. The same way they first need to bootstrap the node. |
PhilippGackstatter
left a comment
There was a problem hiding this comment.
Partial review.
| let mast_store = TransactionMastStore::new(); | ||
| mast_store.load_account_code(account.code()); |
There was a problem hiding this comment.
This will also eventually need to load the native fee asset account's account code (USDCx faucet) since transferring USDCx makes a callback (blocklist check) so the foreign account is required, and this DataStore does not support get_foreign_account_inputs.
So, I think we need to pass in the native faucet state at the reference block to this data store.
There was a problem hiding this comment.
Faucet handling is now separated into draft PR #2650 for further design review. This PR returns todo in followup: support native faucet callbacks from the unsupported foreign-account and storage-map methods. ECDSA and the other deployment review fixes remain here.
There was a problem hiding this comment.
Actually no, I'll handle this in a dedicated PR. This might warrant some discussion.
7bedab6 to
cfcccb5
Compare
cfcccb5 to
ecc8ccb
Compare
PhilippGackstatter
left a comment
There was a problem hiding this comment.
Looks good to me!
1c97b1e to
abea398
Compare
Adds
miden-node fee-collectorcommands tocreateanddeploythe fee collector account used by the sequencer to transfer transaction fees to the batch builder wallet.These need to be run as part of bootstrapping the
sequencernode. The existingbootstrapcommand remains as is, because it is shared by all nodes.The
deploystep appends a single block to the chain which deploys the account. All proving etc is done locally to minimize external interfaces, though they could be added easily enough. This only occurs (hopefully) once per chain, so its not a big deal imo.Part of #2501.
Changelog