Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
@tbfleming tbfleming cleanup 2a2a1c9 Jul 3, 2019
1 contributor

Users who have contributed to this file

27 lines (18 sloc) 917 Bytes

Get Current Producer

Simple Summary

Provide the current producer to contracts

Abstract

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.

Specification

This consensus upgrade adds this intrinsic:

name get_current_producer();
  • 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.
You can’t perform that action at this time.