Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

MultiPhase Election: trim solution also by length. #8315

@kianenigma

Description

@kianenigma

We want to make sure that the offchain worker solution always actually submits something acceptable to the chain, even at the cost of trimming the solution.

Currently, we, trim the solution weight-wise, but we forget to look at it length-wise.

Similar to weight, we won't know how much length we should allow at the time we construct the call. This depends on the moment at which we include the transaction. Given the high priority of the unsigned transaction, we should advise users to set this to a number either the same as MaxBlockWeight or almost all of it. But end of the day, this number should be configurable, exactly similar to the MaxMinerWeight.

https://github.com/paritytech/substrate/blob/master/frame/election-provider-multi-phase/src/lib.rs#L526

We are not sure when we reach this bottleneck, but once we do, we should be ready for it. I advise to do this as simple as possible: remove voters from least-stake, until the length is small enough. If we move to multi-block operations, we can circumvent this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    J0-enhancementAn additional feature request.

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions