This results in the wrong author of the block being shown at the edge of epochs when validators set updated.
For example, if you check https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fmainnet-archive.chainflip.io#/explorer/query/136993 (this is the first block of epoch) you can see its author iscFLq56dodm9uWSqxc2HBD4jAjqxzEQukZ7hPKV6BDoyMHkD26,
but if you load the same block using SubstrateInterface
si.get_block_header(si.get_block_hash(136993), include_author=True)["author"] it'll show cFPAWLomZyFwZLgyTrnZVM5Va9GSK2vdG8sNftnxZ4AZ8yHgq, because it's loaded from current epoch validator set and not the previous one
Here https://github.com/polkascan/py-substrate-interface/blob/master/substrateinterface/base.py#L2358 you do
validator_set = self.query("Session", "Validators", block_hash=block_hash)
And block_hash equals the block we're querying for.But here https://github.com/chainflip-io/polkadot-sdk/blob/chainflip/polkadot-v1.6.0/substrate/client/consensus/aura/src/import_queue.rs#L196 it's implemented differently. They actually get validator set for parent hash.
This results in the wrong author of the block being shown at the edge of epochs when validators set updated.
For example, if you check https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fmainnet-archive.chainflip.io#/explorer/query/136993 (this is the first block of epoch) you can see its author is
cFLq56dodm9uWSqxc2HBD4jAjqxzEQukZ7hPKV6BDoyMHkD26
, but if you load the same block using SubstrateInterfacesi.get_block_header(si.get_block_hash(136993), include_author=True)["author"]
it'll showcFPAWLomZyFwZLgyTrnZVM5Va9GSK2vdG8sNftnxZ4AZ8yHgq
, because it's loaded from current epoch validator set and not the previous one