diff --git a/contracts/crates/chainlink-solana-data-streams/README.md b/contracts/crates/chainlink-solana-data-streams/README.md index 0799dd8fa..3d44071ab 100644 --- a/contracts/crates/chainlink-solana-data-streams/README.md +++ b/contracts/crates/chainlink-solana-data-streams/README.md @@ -20,6 +20,11 @@ let config_account = VerifierInstructions::get_config_pda(&signed_report, verifi #### Creating Instructions ```rust use verify_sdk::VerifierInstructions; +use snap::raw::Encoder; + +// Reports must be compressed with snappy format prior to being sent to the verifier program +let mut encoder = Encoder::new(); +let compressed_report = encoder.compress_vec(&signed_report).expect("Compression failed"); // Create a verify instruction let ix = VerifierInstructions::verify( @@ -28,7 +33,7 @@ let ix = VerifierInstructions::verify( &access_controller, // Access controller account pubkey &user, // User account (must be signer) &config_account, // Report Config PDA derived from report bytes (prevously derived PDA) - signed_report, // Report bytes from Data Streams Off-Chain Server + compressed_report, // Report bytes from Data Streams DON compressed in snappy format ); ``` diff --git a/contracts/crates/chainlink-solana-data-streams/src/lib.rs b/contracts/crates/chainlink-solana-data-streams/src/lib.rs index 78d9805b1..0bb942dbb 100644 --- a/contracts/crates/chainlink-solana-data-streams/src/lib.rs +++ b/contracts/crates/chainlink-solana-data-streams/src/lib.rs @@ -38,9 +38,9 @@ impl VerifierInstructions { /// * `program_id` - The public key of the verifier program. /// * `verifier_account` - The public key of the verifier account. The function [`Self::get_verifier_config_pda`] can be used to calculate this. /// * `access_controller_account` - The public key of the access controller account. - /// * `user` - The public key of the user - this account must be a signer + /// * `user` - The public key of the user - this account must be a signer. /// * `report_config_account` - The public key of the report configuration account. The function [`Self::get_config_pda`] can be used to calculate this. - /// * `signed_report` - The signed report data as a vector of bytes. Returned from data streams API/WS + /// * `signed_report` - Report bytes from Data Streams DON compressed in snappy format /// /// # Returns /// @@ -82,7 +82,7 @@ impl VerifierInstructions { } /// Helper to compute the report config PDA account. This uses the first 32 bytes of the - /// uncompressed report as the seed. This is validated within the verifier program + /// raw uncompressed report as the seed. This is validated within the verifier program pub fn get_config_pda(report: &[u8], program_id: &Pubkey) -> Pubkey { Pubkey::find_program_address(&[&report[..32]], program_id).0 }