Skip to content

fetch weights from remote node #12

@niklasad1

Description

@niklasad1

Currently, the weights are hardcoded for each chain because the MinerConfig trait from substrate is required to be implemented.

Instead ideally it would be useful if we could just get the weights via runtime RPC API.
Perhaps something like:

   fn weight_from_extrinsic(uxt: UnsignedExtrinsic) -> Weight

Similar to https://github.com/paritytech/polkadot/blob/master/runtime/polkadot/src/weights/pallet_election_provider_multi_phase.rs#L142-#L153

Then just plug add the Weight as a parameter to the call to mine_solution_with_snapshot.

Which in turn requires changes in EPM pallet to remove solution_weight from the Miner trait.

That pretty much would make it work.

paritytech/substrate#11665 might help with this.

/cc @kianenigma

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions