Don't repeatedly lookup keys in `babe_epochAuthorship` rpc function (#5962)
* babe: don't repeatedly lookup keys in authorship rpc function Expose a new function `claim_slot_using_keypars` in Babe so that the `babe_epochAuthorship` can lookup authorship for all slots in the epoch without repeatedly looking up keys in the keystore. Time to run the `babe_epochAuthorship` RPC call goes from 7s to 25ms on a local dev chain on my machine. * babe: pass reference to slice instead of ref to Vec * babe: fix bunch of clippy warnings
Showing
- substrate/client/consensus/babe/rpc/src/lib.rs 13 additions, 2 deletionssubstrate/client/consensus/babe/rpc/src/lib.rs
- substrate/client/consensus/babe/src/authorship.rs 32 additions, 26 deletionssubstrate/client/consensus/babe/src/authorship.rs
- substrate/client/consensus/babe/src/aux_schema.rs 1 addition, 1 deletionsubstrate/client/consensus/babe/src/aux_schema.rs
- substrate/client/consensus/babe/src/lib.rs 9 additions, 10 deletionssubstrate/client/consensus/babe/src/lib.rs
Please register or sign in to comment