Get Current Producer
Provide the current producer to contracts
The Subjective Data proposal gives contracts a way to obtain subjective data, but doesn't provide a way for contracts to check its integrity. Contract authors could watch the behavior of their contracts over time for malicious producer behavior, but they don't have a reliable way to restrict their contracts from relying on data from bad producers. This ESR gives contracts this ability.
This consensus upgrade adds this intrinsic:
- When a transaction is speculatively executed, this returns the producer that is scheduled to produce at the current position.
- When a block is being produced, this returns the producer that is producing it.
- What a block is being validated, this returns the producer that produced the block.