Skip to content

[Anvil] Missing functionality required for (or based on) an assethub runtime #369

@iulianbarbu

Description

@iulianbarbu

List of required changes (update this description with more sections if you notice something)

Coinbase customization in the context of assethub AURA compatibility

  1. current implementation will always provide slot 0 as digest for FindAuthor implementation used in the substrate-runtime from anvil-polkadot. This will not work for assethub runtimes because of this check, called here (when applying the timestamp inherent). We must use the existing AuraConsensusDataProvider that's also used with polkadot-omni-node, and compute the slot digest based on the current timestamp (as configured in time manager) and pallet_aura configured slot duration. It means that we might go backwards in terms of slot, which means when setting timestamp, we should also update AURA current slot, to succeed with this check and this check.

  2. assethub runtimes can be configured with multiple authorities (block authors), and aura can pick any of them based on the given slot. Anvil-polkadot coinbase assumes though that we have a single block author address. Forking must configure the authorities set to a set made up from a single authority/coinbase address. This single authority should be picked like anvil does when forking (TO investigate how coinbase address is picked by anvil as block author when forking).

  3. We can use the pallet_aura::FindAccountFromAuthorIndex type for the FindAuthor on the pallet_aura::Config (or pallet-session::FindAccountFromAuthorIndex, via pallet-authorship), for the substrate-runtime, instead of the custom BlockAuthor struct and its FindAuthor impl. This should be done if we don't replace the runtime with an assethub runtime by then.

  4. parachain validation inherent data provider must be built similarly to polkadot-omni-node so that we don't panic here. In the same place we build the timestamp inherent data provider too, but doing it like so should be also backed by 1).

Chain ID customization

Currently we made chain id a storage item in the anvil-polkadot substrate-runtime. This is not the case for assethub runtimes, so we should find a workaround.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions