Documentation ¶
Index ¶
- Constants
- Variables
- func EstimateFeeJuels(callbackGasLimit uint32, maxGasPriceWei, weiPerUnitLink *big.Int) (*big.Int, error)
- func GetStartingResponseCountsV1(q pg.Q, l logger.Logger, chainID uint64, evmFinalityDepth uint32) map[[32]byte]uint64
- func GetStartingResponseCountsV2(q pg.Q, l logger.Logger, chainID uint64, evmFinalityDepth uint32) map[string]uint64
- func MaybeSubtractReservedLink(q pg.Q, startBalance *big.Int, chainID, subID uint64) (*big.Int, error)
- func VRFRandomnessRequestLogTopic() common.Hash
- func ValidatedVRFSpec(tomlString string) (job.Job, error)
- type Config
- type Delegate
- type GethKeyStore
- type RandomnessRequestLog
- type RawRandomnessRequestLog
Constants ¶
const ( // Gas used after computing the payment GasAfterPaymentCalculation = 21000 + 100 + 5000 + 2*2100 + 20000 - 4800 + 6685 // Positive static costs of argument encoding etc. note that it varies by +/- x*12 for every x bytes of non-zero data in the proof. // BatchFulfillmentIterationGasCost is the cost of a single iteration of the batch coordinator's // loop. This is used to determine the gas allowance for a batch fulfillment call. BatchFulfillmentIterationGasCost = 52_000 )
const GasProofVerification uint32 = 200_000
GasProofVerification is an upper limit on the gas used for verifying the VRF proof on-chain. It can be used to estimate the amount of LINK needed to fulfill a request.
Variables ¶
var (
ErrKeyNotSet = errors.New("key not set")
)
Functions ¶
func EstimateFeeJuels ¶ added in v1.2.0
func EstimateFeeJuels(callbackGasLimit uint32, maxGasPriceWei, weiPerUnitLink *big.Int) (*big.Int, error)
EstimateFeeJuels estimates the amount of link needed to fulfill a request given the callback gas limit, the gas price, and the wei per unit link. An error is returned if the wei per unit link provided is zero.
func GetStartingResponseCountsV1 ¶ added in v1.1.0
func GetStartingResponseCountsV2 ¶ added in v1.0.0
func MaybeSubtractReservedLink ¶ added in v1.1.0
func MaybeSubtractReservedLink(q pg.Q, startBalance *big.Int, chainID, subID uint64) (*big.Int, error)
MaybeSubtractReservedLink figures out how much LINK is reserved for other VRF requests that have not been fully confirmed yet on-chain, and subtracts that from the given startBalance, and returns that value if there are no errors.
func VRFRandomnessRequestLogTopic ¶ added in v1.1.0
VRFRandomnessRequestLogTopic returns the signature of the RandomnessRequest log emitted by the VRFCoordinator contract
Types ¶
type Delegate ¶ added in v0.10.8
type Delegate struct {
// contains filtered or unexported fields
}
func NewDelegate ¶ added in v0.10.8
func (*Delegate) AfterJobCreated ¶ added in v0.10.11
func (*Delegate) BeforeJobDeleted ¶ added in v0.10.11
func (*Delegate) ServicesForSpec ¶ added in v0.10.8
ServicesForSpec satisfies the job.Delegate interface.
type GethKeyStore ¶ added in v0.10.8
type RandomnessRequestLog ¶ added in v0.8.2
type RandomnessRequestLog struct { KeyHash common.Hash Seed *big.Int // uint256 JobID common.Hash Sender common.Address Fee *assets.Link // uint256 RequestID common.Hash Raw RawRandomnessRequestLog }
RandomnessRequestLog contains the data for a RandomnessRequest log, represented as compatible golang types.
func ParseRandomnessRequestLog ¶ added in v0.8.2
func ParseRandomnessRequestLog(log types.Log) (*RandomnessRequestLog, error)
ParseRandomnessRequestLog returns the RandomnessRequestLog corresponding to the raw logData
func RawRandomnessRequestLogToRandomnessRequestLog ¶ added in v0.8.2
func RawRandomnessRequestLogToRandomnessRequestLog( l *RawRandomnessRequestLog) *RandomnessRequestLog
func (*RandomnessRequestLog) ComputedRequestID ¶ added in v1.1.0
func (l *RandomnessRequestLog) ComputedRequestID() common.Hash
func (*RandomnessRequestLog) Equal ¶ added in v0.8.2
func (l *RandomnessRequestLog) Equal(ol RandomnessRequestLog) bool
Equal(ol) is true iff l is the same log as ol, and both represent valid RandomnessRequest logs.
func (*RandomnessRequestLog) RawData ¶ added in v0.8.2
func (l *RandomnessRequestLog) RawData() ([]byte, error)
RawData returns the raw bytes corresponding to l in a solidity log
This serialization does not include the JobID, because that's an indexed field.
type RawRandomnessRequestLog ¶ added in v0.8.2
type RawRandomnessRequestLog solidity_vrf_coordinator_interface.VRFCoordinatorRandomnessRequest
RawRandomnessRequestLog is used to parse a RandomnessRequest log into types go-ethereum knows about.