Documentation
¶
Index ¶
- Constants
- Variables
- type OffchainConfig
- func (*OffchainConfig) Descriptor() ([]byte, []int)deprecated
- func (c *OffchainConfig) Encode() ([]byte, error)
- func (x *OffchainConfig) GetDeltaGrace() uint64
- func (x *OffchainConfig) GetDeltaProgress() uint64
- func (x *OffchainConfig) GetDeltaResend() uint64
- func (x *OffchainConfig) GetDeltaRound() uint64
- func (x *OffchainConfig) GetDeltaStage() uint64
- func (x *OffchainConfig) GetMaxDurationObservation() uint64
- func (x *OffchainConfig) GetMaxDurationQuery() uint64
- func (x *OffchainConfig) GetMaxDurationReport() uint64
- func (x *OffchainConfig) GetMaxDurationShouldAcceptFinalizedReport() uint64
- func (x *OffchainConfig) GetMaxDurationShouldTransmitAcceptedReport() uint64
- func (x *OffchainConfig) GetOffchainPublicKeys() [][]byte
- func (x *OffchainConfig) GetPeerIds() []string
- func (x *OffchainConfig) GetRMax() uint32
- func (x *OffchainConfig) GetReportingPluginConfig() []byte
- func (x *OffchainConfig) GetS() []uint32
- func (x *OffchainConfig) GetSharedSecretEncryptions() *SharedSecretEncryptionsProto
- func (*OffchainConfig) ProtoMessage()
- func (x *OffchainConfig) ProtoReflect() protoreflect.Message
- func (x *OffchainConfig) Reset()
- func (x *OffchainConfig) String() string
- type SharedSecretEncryptions
- type SharedSecretEncryptionsProto
- func (*SharedSecretEncryptionsProto) Descriptor() ([]byte, []int)deprecated
- func (x *SharedSecretEncryptionsProto) GetDiffieHellmanPoint() []byte
- func (x *SharedSecretEncryptionsProto) GetEncryptions() [][]byte
- func (x *SharedSecretEncryptionsProto) GetSharedSecretHash() []byte
- func (*SharedSecretEncryptionsProto) ProtoMessage()
- func (x *SharedSecretEncryptionsProto) ProtoReflect() protoreflect.Message
- func (x *SharedSecretEncryptionsProto) Reset()
- func (x *SharedSecretEncryptionsProto) String() string
Constants ¶
Variables ¶
var File_offchain_config_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type OffchainConfig ¶
type OffchainConfig struct {
DeltaProgress uint64 `protobuf:"varint,1,opt,name=delta_progress,json=deltaProgress,proto3" json:"delta_progress,omitempty"`
DeltaResend uint64 `protobuf:"varint,2,opt,name=delta_resend,json=deltaResend,proto3" json:"delta_resend,omitempty"`
DeltaRound uint64 `protobuf:"varint,3,opt,name=delta_round,json=deltaRound,proto3" json:"delta_round,omitempty"`
DeltaGrace uint64 `protobuf:"varint,4,opt,name=delta_grace,json=deltaGrace,proto3" json:"delta_grace,omitempty"`
DeltaStage uint64 `protobuf:"varint,5,opt,name=delta_stage,json=deltaStage,proto3" json:"delta_stage,omitempty"`
RMax uint32 `protobuf:"varint,6,opt,name=r_max,json=rMax,proto3" json:"r_max,omitempty"`
S []uint32 `protobuf:"varint,7,rep,packed,name=s,proto3" json:"s,omitempty"`
OffchainPublicKeys [][]byte `protobuf:"bytes,8,rep,name=offchain_public_keys,json=offchainPublicKeys,proto3" json:"offchain_public_keys,omitempty"`
PeerIds []string `protobuf:"bytes,9,rep,name=peer_ids,json=peerIds,proto3" json:"peer_ids,omitempty"`
ReportingPluginConfig []byte `` /* 127-byte string literal not displayed */
MaxDurationQuery uint64 `protobuf:"varint,11,opt,name=max_duration_query,json=maxDurationQuery,proto3" json:"max_duration_query,omitempty"`
MaxDurationObservation uint64 `` /* 131-byte string literal not displayed */
MaxDurationReport uint64 `protobuf:"varint,13,opt,name=max_duration_report,json=maxDurationReport,proto3" json:"max_duration_report,omitempty"`
MaxDurationShouldAcceptFinalizedReport uint64 `` /* 185-byte string literal not displayed */
MaxDurationShouldTransmitAcceptedReport uint64 `` /* 188-byte string literal not displayed */
// contains filtered or unexported fields
}
func DecodeConfig ¶
func DecodeConfig(b []byte) (*OffchainConfig, error)
func (*OffchainConfig) Descriptor
deprecated
func (*OffchainConfig) Descriptor() ([]byte, []int)
Deprecated: Use OffchainConfig.ProtoReflect.Descriptor instead.
func (*OffchainConfig) Encode ¶
func (c *OffchainConfig) Encode() ([]byte, error)
func (*OffchainConfig) GetDeltaGrace ¶
func (x *OffchainConfig) GetDeltaGrace() uint64
func (*OffchainConfig) GetDeltaProgress ¶
func (x *OffchainConfig) GetDeltaProgress() uint64
func (*OffchainConfig) GetDeltaResend ¶
func (x *OffchainConfig) GetDeltaResend() uint64
func (*OffchainConfig) GetDeltaRound ¶
func (x *OffchainConfig) GetDeltaRound() uint64
func (*OffchainConfig) GetDeltaStage ¶
func (x *OffchainConfig) GetDeltaStage() uint64
func (*OffchainConfig) GetMaxDurationObservation ¶
func (x *OffchainConfig) GetMaxDurationObservation() uint64
func (*OffchainConfig) GetMaxDurationQuery ¶
func (x *OffchainConfig) GetMaxDurationQuery() uint64
func (*OffchainConfig) GetMaxDurationReport ¶
func (x *OffchainConfig) GetMaxDurationReport() uint64
func (*OffchainConfig) GetMaxDurationShouldAcceptFinalizedReport ¶
func (x *OffchainConfig) GetMaxDurationShouldAcceptFinalizedReport() uint64
func (*OffchainConfig) GetMaxDurationShouldTransmitAcceptedReport ¶
func (x *OffchainConfig) GetMaxDurationShouldTransmitAcceptedReport() uint64
func (*OffchainConfig) GetOffchainPublicKeys ¶
func (x *OffchainConfig) GetOffchainPublicKeys() [][]byte
func (*OffchainConfig) GetPeerIds ¶
func (x *OffchainConfig) GetPeerIds() []string
func (*OffchainConfig) GetRMax ¶
func (x *OffchainConfig) GetRMax() uint32
func (*OffchainConfig) GetReportingPluginConfig ¶
func (x *OffchainConfig) GetReportingPluginConfig() []byte
func (*OffchainConfig) GetS ¶
func (x *OffchainConfig) GetS() []uint32
func (*OffchainConfig) GetSharedSecretEncryptions ¶
func (x *OffchainConfig) GetSharedSecretEncryptions() *SharedSecretEncryptionsProto
func (*OffchainConfig) ProtoMessage ¶
func (*OffchainConfig) ProtoMessage()
func (*OffchainConfig) ProtoReflect ¶
func (x *OffchainConfig) ProtoReflect() protoreflect.Message
func (*OffchainConfig) Reset ¶
func (x *OffchainConfig) Reset()
func (*OffchainConfig) String ¶
func (x *OffchainConfig) String() string
type SharedSecretEncryptions ¶
type SharedSecretEncryptions struct {
DiffieHellmanPoint [curve25519.PointSize]byte
//
// Since SharedSecretEncryptions are shared through a smart contract, each
// oracle will see the same SharedSecretHash. After decryption, oracles can
// check their sharedSecret against SharedSecretHash to prevent the dealer
// from equivocating
SharedSecretHash common.Hash
// i-th oracle can recover the key as follows:
//
// 1. key := Keccak256(DH(DiffieHellmanPoint, process' secret key))[:16]
// 2. sharedSecret := AES128DecryptBlock(key, Encryptions[i])
//
// See Decrypt for details.
Encryptions []encryptedSharedSecret
}
SharedSecretEncryptions is the encryptions of SharedConfig.SharedSecret, using each oracle's SharedSecretEncryptionPublicKey.
We use a custom encryption scheme to be more space-efficient (compared to standard AEAD schemes, nacl crypto_box, etc...), which saves gas in transmission to the OCR2Aggregator.
func EncryptSharedSecret ¶
func EncryptSharedSecret( keys []ocrtypes.SharedSecretEncryptionPublicKey, sharedSecret *[SharedSecretSize]byte, rand io.Reader, ) SharedSecretEncryptions
EncryptSharedSecret constructs a SharedSecretEncryptions from a set of SharedSecretEncryptionPublicKeys, the sharedSecret, and a cryptographic randomness source
func EncryptSharedSecretInternal ¶
func EncryptSharedSecretInternal( publicKeys []ocrtypes.SharedSecretEncryptionPublicKey, sharedSecret *[SharedSecretSize]byte, sk *[32]byte, ) SharedSecretEncryptions
EncryptSharedSecretInternal constructs a SharedSecretEncryptions from a set of SharedSecretEncryptionPublicKeys, the sharedSecret, and an ephemeral secret key sk
func (SharedSecretEncryptions) Decrypt ¶
func (e SharedSecretEncryptions) Decrypt(oid commontypes.OracleID, k types.OffchainKeyring) (*[SharedSecretSize]byte, error)
Decrypt returns the sharedSecret
func (SharedSecretEncryptions) Equal ¶
func (e SharedSecretEncryptions) Equal(e2 SharedSecretEncryptions) bool
func (SharedSecretEncryptions) Proto ¶
func (e SharedSecretEncryptions) Proto() *SharedSecretEncryptionsProto
type SharedSecretEncryptionsProto ¶
type SharedSecretEncryptionsProto struct {
// contains filtered or unexported fields
}
func (*SharedSecretEncryptionsProto) Descriptor
deprecated
func (*SharedSecretEncryptionsProto) Descriptor() ([]byte, []int)
Deprecated: Use SharedSecretEncryptionsProto.ProtoReflect.Descriptor instead.
func (*SharedSecretEncryptionsProto) GetDiffieHellmanPoint ¶
func (x *SharedSecretEncryptionsProto) GetDiffieHellmanPoint() []byte
func (*SharedSecretEncryptionsProto) GetEncryptions ¶
func (x *SharedSecretEncryptionsProto) GetEncryptions() [][]byte
func (*SharedSecretEncryptionsProto) GetSharedSecretHash ¶
func (x *SharedSecretEncryptionsProto) GetSharedSecretHash() []byte
func (*SharedSecretEncryptionsProto) ProtoMessage ¶
func (*SharedSecretEncryptionsProto) ProtoMessage()
func (*SharedSecretEncryptionsProto) ProtoReflect ¶
func (x *SharedSecretEncryptionsProto) ProtoReflect() protoreflect.Message
func (*SharedSecretEncryptionsProto) Reset ¶
func (x *SharedSecretEncryptionsProto) Reset()
func (*SharedSecretEncryptionsProto) String ¶
func (x *SharedSecretEncryptionsProto) String() string