-
Notifications
You must be signed in to change notification settings - Fork 9
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
refactor(mainnet): use genesis presets for mainnet runtime. #473
refactor(mainnet): use genesis presets for mainnet runtime. #473
Conversation
ae4800d
to
bb2046b
Compare
10ffbe2
to
7aa5ddf
Compare
d87cd19
to
8716241
Compare
7aa5ddf
to
0d5c46a
Compare
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## al3mart/refactor-genesis-preset-testnet #473 +/- ##
===========================================================================
+ Coverage 76.18% 77.38% +1.19%
===========================================================================
Files 92 93 +1
Lines 18354 18758 +404
Branches 18354 18758 +404
===========================================================================
+ Hits 13983 14515 +532
+ Misses 4105 3977 -128
Partials 266 266
|
62d1013
to
2f47e84
Compare
09c4cfa
to
77cc194
Compare
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.
Well done, left some comments.
This PR is heavily correlated with the launch of devnet and testnet. Would be nice to hear what the plan is in terms of updating keys etc.
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.
Left a few nits, should be close to approving
endowed_accounts.push(MaintenanceAccount::get()); | ||
endowed_accounts.push(PotId::get().into_account_truncating()); | ||
endowed_accounts.push(TreasuryAccount::get()); |
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.
Thoughts on giving these accounts only ED?
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.
runtime/mainnet/src/genesis.rs
Outdated
vec![GenesisAsset { | ||
id: 0, | ||
owner: Keyring::Alice.to_account_id(), | ||
is_sufficient: false, | ||
min_balance: ExistentialDeposit::get(), | ||
name: "DOT".into(), | ||
symbol: "DOT".into(), | ||
decimals: 10, | ||
}], |
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.
I realize you are getting conflicting code direction. However, for mainnet I would like to exclude this.
I am still not sold that we should have devs use the fungibles API for DOT. It introduces complexity (and potentially bad DevEx) due to pallet-balances missing functionality that pallet-assets has.
By including, we can forget its there. By excluding, we have to consciously add it in -- when we confirm it works.
If we want to reserve asset id 0, I recommend using another name than "DOT" as a placeholder.
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.
Happy to remove from mainnet.
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.
runtime/mainnet/src/genesis.rs
Outdated
let mut endowed_accounts = dev_accounts(); | ||
endowed_accounts.push(MaintenanceAccount::get()); | ||
endowed_accounts.push(PotId::get().into_account_truncating()); | ||
endowed_accounts.push(SudoAddress::get()); |
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.
SudoAddress is a multisig, right? That would mean for the local_config we wouldn't be able to use Sudo.
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.
This also means there is a flaw in the test
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.
runtime/mainnet/src/genesis.rs
Outdated
vec![GenesisAsset { | ||
id: 0, | ||
owner: SudoAddress::get(), | ||
is_sufficient: false, | ||
min_balance: ExistentialDeposit::get(), | ||
name: "DOT".into(), | ||
symbol: "DOT".into(), | ||
decimals: 10, | ||
}], |
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.
Similarly, (for mainnet only) please remove or change the name from "DOT"
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.
runtime/mainnet/src/genesis.rs
Outdated
}) | ||
} | ||
|
||
// The initial balances at genesis. |
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.
// The initial balances at genesis. | |
// The initial balances at genesis for local testing only. |
might consider adding this as well.
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.
Endowments have been improved in: 1ea9626 Such that only dev accounts get ENDOWMENT amount and all the rest are only funded with ED. No assets are stores at genesis anymore: 57f4d96. This should solve all the concerns above. |
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.
Still some comments unresolved and added some.
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.
LGTM! Do we need to ensure that the genesis hash is the same as the one already registered on chain?
No, it won't be. |
f2691e4
into
al3mart/refactor-genesis-preset-testnet
* refactor(mainnet): collation config (#439) * refactor(mainnet): add pallet_authorship to collation * test(mainnet): add pallet_auhtorship test * refactor(mainnet): add pallet_aura to collation * test(mainnet): add pallet_aura tests * refactor(mainnet): add collator_selection to collation * test(mainnet): add collator_selection tests * refactor(mainnet): add pallet_session & aura_ext to collation * test(mainnet): add pallet_session tests * chore(aura): MaxAuthorities matches max possible blocks produced * remove unnused imports * style(collation): order tests following pallet config * style(collation): remove unnecessary qualifications * style(collation): max_authorities_is_3600 * style(collation): reorg definition in session_keys_provided_by_aura test * style(collation): better Period comment * style(collation): clarify session::SessionHandler comment * refactor(collation): separate tests in modules by pallet * style(collation): Explain SessionHandler config fixes after rebase * style(collation): remove prefixes from tests * style(collation): Period comment was not helpful changes after rebase * chore(mainnet): remove duplicate module after rebase * refactor(testnet): use genesis presets * chore(testnet): add presetse to runtime api * fix(genesis): bring vec into scope & clean build * docs(genesis): improve testnet genesis spec comments * chore(zombienet): update zombienet network spec * refactor(genesis): inlcude genesis asset * refactor(genesis): amend runtime pattern matcher for testnet * style(chainspec): use Pop for testnet name * refactor(genesis): use Alice as sudo account in local config * refactor(genesis): use sudo as the genesis asset owner * fix(genesis): missing clone for sudo_key * refactor(mainnet): use genesis presets for mainnet runtime. (#473) * refactor(mainnet): use genesis presets * refactor(genesis): removed unused Relay struct * fix(genesis): bring vec into scope & clean build * chore(zombienet): update zombienet network spec * refacotr(genesis): include genesis assets * refactor(genesis): add genesis councilors * test(chainspec): test spec configuration for mainnet * fix(genesis): missing runtime type in sudo tests * test(genesis): add mainnet genesis tests * style(chainspec): use Pop as runtime name * refactor(genesis): don't set ah as owner of genesis asset * fix(chainspec): amend mainnet spec tests * refactor(genesis): apply feedback * refactor(genesis): better endowments * refactor(genesis): remove genesis assets * Update runtime/mainnet/src/genesis.rs * Update runtime/mainnet/src/genesis.rs
* refactor(genesis): wip-use genesis presets for devnet runtime * refactor(devnet): remove spec functions from node * chore(devnet): add presets to runtime api * fix(genesis): bring Vec into scope & clean build * chore(zombienet): update zombienet devenet spec * refactor(genesis): add relay asset at genesis * refactor(genesis): genesis asset is not sufficient * style(chainspec): use Pop * fix(devnet): no endowed accounts on devnet live config * refactor(collator_selection): reduce MaxCandidates to 0 * fix(genesis): bring vec into scope * refactor(genesis): apply feedback * refactor(testnet): use genesis presets for testnet runtime. (#472) * refactor(mainnet): collation config (#439) * refactor(mainnet): add pallet_authorship to collation * test(mainnet): add pallet_auhtorship test * refactor(mainnet): add pallet_aura to collation * test(mainnet): add pallet_aura tests * refactor(mainnet): add collator_selection to collation * test(mainnet): add collator_selection tests * refactor(mainnet): add pallet_session & aura_ext to collation * test(mainnet): add pallet_session tests * chore(aura): MaxAuthorities matches max possible blocks produced * remove unnused imports * style(collation): order tests following pallet config * style(collation): remove unnecessary qualifications * style(collation): max_authorities_is_3600 * style(collation): reorg definition in session_keys_provided_by_aura test * style(collation): better Period comment * style(collation): clarify session::SessionHandler comment * refactor(collation): separate tests in modules by pallet * style(collation): Explain SessionHandler config fixes after rebase * style(collation): remove prefixes from tests * style(collation): Period comment was not helpful changes after rebase * chore(mainnet): remove duplicate module after rebase * refactor(testnet): use genesis presets * chore(testnet): add presetse to runtime api * fix(genesis): bring vec into scope & clean build * docs(genesis): improve testnet genesis spec comments * chore(zombienet): update zombienet network spec * refactor(genesis): inlcude genesis asset * refactor(genesis): amend runtime pattern matcher for testnet * style(chainspec): use Pop for testnet name * refactor(genesis): use Alice as sudo account in local config * refactor(genesis): use sudo as the genesis asset owner * fix(genesis): missing clone for sudo_key * refactor(mainnet): use genesis presets for mainnet runtime. (#473) * refactor(mainnet): use genesis presets * refactor(genesis): removed unused Relay struct * fix(genesis): bring vec into scope & clean build * chore(zombienet): update zombienet network spec * refacotr(genesis): include genesis assets * refactor(genesis): add genesis councilors * test(chainspec): test spec configuration for mainnet * fix(genesis): missing runtime type in sudo tests * test(genesis): add mainnet genesis tests * style(chainspec): use Pop as runtime name * refactor(genesis): don't set ah as owner of genesis asset * fix(chainspec): amend mainnet spec tests * refactor(genesis): apply feedback * refactor(genesis): better endowments * refactor(genesis): remove genesis assets * Update runtime/mainnet/src/genesis.rs * Update runtime/mainnet/src/genesis.rs
Based on #472
Moves genesis configuration for mainnet into the runtime.
These are the different spec that will use the mainnet runtime. These are the ones we can pass to the node via
--chain <spec>
.Requirements:
[sc-2373]