-
Notifications
You must be signed in to change notification settings - Fork 18
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
Genesis Transactions #127
Genesis Transactions #127
Conversation
Signed-off-by: muraca <mmuraca247@gmail.com>
…nesisBlockBuilder` Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
Quick recap of what happens:
|
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
@JoshOrndorff I think the |
tuxedo-template-runtime/src/lib.rs
Outdated
// TODO: Initial Transactions for Kitties | ||
|
||
// TODO: Initial UTXO for Existence | ||
// TODO: Initial Transactions for Existence |
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.
Seems like a good time to resolve these. I think any example from any other piece would be sufficient. So maybe add a single PoE claim to genesis block, or a single amoeba creation to the genesis block.
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
I just found out there is some ongoing issue in Substrate about genesis block builder and genesis config and chain spec and how to do it after the native runtime is deprecated. |
I'd say let's conclude what we have going on now, and later adhere to the new native runtime free standards when everything is finished and well documented. |
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
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.
Nice work! This is a next-level job. These traits are not well explored or documented. Cool that we made it work.
I'm not sure executing them adds much value. This happens only at chain launch time, and I think that looking carefully at the genesis block (especially now that it explicitly contains all genesis state) is the duty of someone wanting to use the chain. Basically I'm arguing that the genesis block is like a summary of the prehistory and it's okay if the semantics are squishy or manually enforced for this one-time process to launch the chain. So IMO this resolves #107 fully. |
Signed-off-by: muraca <mmuraca247@gmail.com>
This PR introduces genesis transactions, which are neither validated nor executed.
They are stored in the genesis block, and their outputs are saved in storage as well.
Resolves #107 and blocks #128
Changelog:
std
-gated functionInherentHooks::genesis_transactions
to generate genesis inherents.GenesisConfig
's only parameter is now aVec<Transaction>
.tuxedo-core/src/genesis.rs
which contains:TuxedoGenesisBlockBuilder
based on the one I implemented in GenesisBuilder with extrinsics execution #123, which reads the extrinsics list from storage keyEXTRINSICS_KEY
, to include them in the genesis block.std
-gated functionassimilate_storage
, which:genesis_transactions
list after the keyEXTRINSICS_KEY
;Transaction
s have no inputs or peeks;Output
s of thegenesis_transactions
are stored based on theTransaction
that created them.<TuxedoGenesisConfig as BuildStorage>::assimilate_storage
:genesis_transactions
list appending atInherentHooks::genesis_transactions
itsTuxedoGenesisConfig.genesis_transactions
, since the inherents should appear at the beginning of the block;genesis.rs/assimilate_storage
;TuxedoGenesisBlockBuilder
using the traitBuildStorage
.