1

There's code in Grandpa to have different "Authority Weights" assigned to each validator. It doesn't appear to be accessible beyond in a genesis block. Does someone know the intended purpose of that code? Why would you want to give certain authorities more weight in the finalization process?

____ Edit to include links ____

AuthorityWeight here: https://github.com/paritytech/polkadot-sdk/blob/db3fd687262c68b115ab6724dfaa6a71d4a48a59/substrate/primitives/consensus/grandpa/src/lib.rs#L82

Genesis allows supplying weight: https://github.com/paritytech/polkadot-sdk/blob/db3fd687262c68b115ab6724dfaa6a71d4a48a59/substrate/frame/grandpa/src/lib.rs#L348

Weights are hardcoded to "1" after genesis: https://github.com/paritytech/polkadot-sdk/blob/db3fd687262c68b115ab6724dfaa6a71d4a48a59/substrate/frame/grandpa/src/lib.rs#L582

2
  • Can you share a link? Oct 3, 2023 at 9:51
  • Sure. Edited to include links
    – blakeb
    Oct 3, 2023 at 12:52

1 Answer 1

1

I think this is a result of making Substrate unopinionated. By including weights in core authority structures by default you allow individual chains to set weights in the way best suiting them.

A simple reason you might want adjustable weights is to allow validators with more stake to have proportionally more voting power.

In practice this flexibility isn't used at all by most chains right now, including Polkadot.

1
  • That makes sense. I was thinking it might be an interesting way to have "known" authorities have an outsized vote on finality to protect against a 51% attack. As it stands though, you can't override the SessionHandler in the Grandpa frame or set the weights from outside because everything is crate private. I wonder if this is unfinished/forgotten feature/or what.
    – blakeb
    Oct 4, 2023 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.