pub struct OracleUpdateResult {
pub oracle_id: OracleId,
pub target_timestamp: TimestampMs,
pub response_hash: [u8; 32],
pub input_commitment: InputCommitmentBytes,
pub signature: SignatureBytes,
pub oracle_result: Vec<u8>,
pub attestation_report: Option<AttestationReport>,
pub authority_key: AuthorityKeyBytes,
}Expand description
A structure representing the result of an oracle update This structure is designed to fit within Solana’s transaction size limit TODO: https://linear.app/subzero-labs/issue/SUB-449/audit-transaction-sizes-in-the-oracle-subsystem
Fields§
§oracle_id: OracleIdThe identifier of the oracle (should be kept under 100 bytes)
target_timestamp: TimestampMsThe round in which this result should be proposed
response_hash: [u8; 32]Blake3 hash of oracle_result (32 bytes)
input_commitment: InputCommitmentBytesBlake3 hash commitment of the original request input bytes (32 bytes) This is included in the signature transcript to bind the response to the exact request payload observed by the oracle service.
signature: SignatureBytesSignature of the hash of the oracle response, base64 encoded.
oracle_result: Vec<u8>Response data (up to MAX_ORACLE_RESPONSE_DATA_SIZE bytes in size)
attestation_report: Option<AttestationReport>Optional attestation report, if available This can be used to provide additional context or verification of the oracle result.
Validator’s protocol public key bytes of the validator that executed the edge rquest.
Implementations§
Source§impl OracleUpdateResult
impl OracleUpdateResult
Sourcepub fn new(
oracle_id: OracleId,
target_timestamp: TimestampMs,
oracle_result: Vec<u8>,
input_commitment: InputCommitmentBytes,
signature: SignatureBytes,
attestation_report: Option<AttestationReport>,
authority_key: AuthorityKeyBytes,
) -> Result<Self, &'static str>
pub fn new( oracle_id: OracleId, target_timestamp: TimestampMs, oracle_result: Vec<u8>, input_commitment: InputCommitmentBytes, signature: SignatureBytes, attestation_report: Option<AttestationReport>, authority_key: AuthorityKeyBytes, ) -> Result<Self, &'static str>
Create an OracleUpdateResult
Trait Implementations§
Source§impl Clone for OracleUpdateResult
impl Clone for OracleUpdateResult
Source§fn clone(&self) -> OracleUpdateResult
fn clone(&self) -> OracleUpdateResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OracleUpdateResult
impl Debug for OracleUpdateResult
Source§impl Default for OracleUpdateResult
impl Default for OracleUpdateResult
Source§impl<'de> Deserialize<'de> for OracleUpdateResult
impl<'de> Deserialize<'de> for OracleUpdateResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for OracleUpdateResult
impl PartialEq for OracleUpdateResult
Source§impl Serialize for OracleUpdateResult
impl Serialize for OracleUpdateResult
impl Eq for OracleUpdateResult
impl StructuralPartialEq for OracleUpdateResult
Auto Trait Implementations§
impl Freeze for OracleUpdateResult
impl RefUnwindSafe for OracleUpdateResult
impl Send for OracleUpdateResult
impl Sync for OracleUpdateResult
impl Unpin for OracleUpdateResult
impl UnsafeUnpin for OracleUpdateResult
impl UnwindSafe for OracleUpdateResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.