diff --git a/examples/functions/01_basic_oracle/Cargo.toml b/examples/functions/01_basic_oracle/Cargo.toml index 2e265090e..4e345144f 100644 --- a/examples/functions/01_basic_oracle/Cargo.toml +++ b/examples/functions/01_basic_oracle/Cargo.toml @@ -19,6 +19,6 @@ cpi = ["no-entrypoint"] default = [] [dependencies] -switchboard-solana = "=0.28.6" +switchboard-solana = { version = "=0.28.15", features = [ ] } # switchboard-solana = { version = "0.28.4", path = "../../../rust/switchboard-solana" } bytemuck = "^1" diff --git a/examples/functions/01_basic_oracle/package.json b/examples/functions/01_basic_oracle/package.json index 9a555e3ad..48d135400 100644 --- a/examples/functions/01_basic_oracle/package.json +++ b/examples/functions/01_basic_oracle/package.json @@ -15,7 +15,7 @@ "@coral-xyz/anchor": "^0.28.0", "@solana/spl-token": "^0.3.6", "@solana/web3.js": "^1.78.0", - "@switchboard-xyz/solana.js": "workspace:^" + "@switchboard-xyz/solana.js": "^" }, "devDependencies": { "@types/bn.js": "^5.1.0", @@ -26,4 +26,4 @@ "mocha": "^9.0.3", "ts-mocha": "^10.0.0" } -} +} \ No newline at end of file diff --git a/examples/functions/01_basic_oracle/sgx-function/Cargo.toml b/examples/functions/01_basic_oracle/sgx-function/Cargo.toml index b9357f10c..30ecce3a9 100644 --- a/examples/functions/01_basic_oracle/sgx-function/Cargo.toml +++ b/examples/functions/01_basic_oracle/sgx-function/Cargo.toml @@ -16,6 +16,6 @@ futures = "0.3" serde = "^1" serde_json = "^1" switchboard-utils = "0.8.0" -switchboard-solana = "=0.28.6" +switchboard-solana = { version = "=0.28.15", features = [ "client" ] } # switchboard-solana = { version = "0.28.4", path = "../../../../rust/switchboard-solana" } # switchboard-utils = { version = "0.8.0", path = "../../../../../../rust/switchboard-utils" } diff --git a/examples/functions/01_basic_oracle/src/actions/trigger_function.rs b/examples/functions/01_basic_oracle/src/actions/trigger_function.rs index e3f1e3b98..53c9b6cc7 100644 --- a/examples/functions/01_basic_oracle/src/actions/trigger_function.rs +++ b/examples/functions/01_basic_oracle/src/actions/trigger_function.rs @@ -37,9 +37,9 @@ impl TriggerFunction<'_> { _params: &TriggerFunctionParams, ) -> anchor_lang::Result<()> { FunctionTrigger { - function: ctx.accounts.function.clone(), - authority: ctx.accounts.authority.clone(), - attestation_queue: ctx.accounts.attestation_queue.clone(), + function: ctx.accounts.function.to_account_info(), + authority: ctx.accounts.authority.to_account_info(), + attestation_queue: ctx.accounts.attestation_queue.to_account_info(), } .invoke(ctx.accounts.attestation_program.clone())?; Ok(()) diff --git a/javascript/solana.js/idl/attestation-devnet.json b/javascript/solana.js/idl/attestation-devnet.json index a032bf046..1c13b0742 100644 --- a/javascript/solana.js/idl/attestation-devnet.json +++ b/javascript/solana.js/idl/attestation-devnet.json @@ -3794,4 +3794,4 @@ "msg": "The FunctionRequestAccount is not ready to be verified" } ] -} +} \ No newline at end of file diff --git a/javascript/solana.js/idl/mainnet.json b/javascript/solana.js/idl/mainnet.json index 6538b7568..1588588c8 100644 --- a/javascript/solana.js/idl/mainnet.json +++ b/javascript/solana.js/idl/mainnet.json @@ -2,6 +2,118 @@ "version": "0.1.0", "name": "switchboard_v2", "instructions": [ + { + "name": "viewVersion", + "accounts": [], + "args": [] + }, + { + "name": "aggregatorClose", + "accounts": [ + { + "name": "authority", + "isMut": false, + "isSigner": true + }, + { + "name": "aggregator", + "isMut": true, + "isSigner": false + }, + { + "name": "permission", + "isMut": true, + "isSigner": false + }, + { + "name": "lease", + "isMut": true, + "isSigner": false + }, + { + "name": "escrow", + "isMut": true, + "isSigner": false + }, + { + "name": "oracleQueue", + "isMut": false, + "isSigner": false + }, + { + "name": "queueAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "programState", + "isMut": false, + "isSigner": false + }, + { + "name": "solDest", + "isMut": false, + "isSigner": false + }, + { + "name": "escrowDest", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "crank", + "isMut": true, + "isSigner": false, + "isOptional": true, + "docs": [ + "Optional accounts" + ] + }, + { + "name": "dataBuffer", + "isMut": true, + "isSigner": false, + "isOptional": true + }, + { + "name": "slidingWindow", + "isMut": true, + "isSigner": false, + "isOptional": true + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": "AggregatorCloseParams" + } + } + ] + }, + { + "name": "setBumps", + "accounts": [ + { + "name": "state", + "isMut": true, + "isSigner": false + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": "SetBumpsParams" + } + } + ] + }, { "name": "aggregatorAddJob", "accounts": [ @@ -338,6 +450,109 @@ } ] }, + { + "name": "aggregatorTeeSaveResult", + "accounts": [ + { + "name": "aggregator", + "isMut": true, + "isSigner": false + }, + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "oracleAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "oracleQueue", + "isMut": false, + "isSigner": false + }, + { + "name": "queueAuthority", + "isMut": false, + "isSigner": false + }, + { + "name": "feedPermission", + "isMut": true, + "isSigner": false + }, + { + "name": "oraclePermission", + "isMut": false, + "isSigner": false + }, + { + "name": "lease", + "isMut": true, + "isSigner": false + }, + { + "name": "escrow", + "isMut": true, + "isSigner": false + }, + { + "name": "tokenProgram", + "isMut": false, + "isSigner": false + }, + { + "name": "programState", + "isMut": false, + "isSigner": false + }, + { + "name": "historyBuffer", + "isMut": true, + "isSigner": false + }, + { + "name": "mint", + "isMut": false, + "isSigner": false + }, + { + "name": "slider", + "isMut": true, + "isSigner": false + }, + { + "name": "quote", + "isMut": false, + "isSigner": true + }, + { + "name": "rewardWallet", + "isMut": true, + "isSigner": false + }, + { + "name": "payer", + "isMut": true, + "isSigner": true + }, + { + "name": "systemProgram", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": "AggregatorTeeSaveResultParams" + } + } + ] + }, { "name": "aggregatorSetAuthority", "accounts": [ @@ -1200,6 +1415,64 @@ } ] }, + { + "name": "oracleTeeHeartbeat", + "accounts": [ + { + "name": "oracle", + "isMut": true, + "isSigner": false + }, + { + "name": "oracleAuthority", + "isMut": false, + "isSigner": true + }, + { + "name": "tokenAccount", + "isMut": false, + "isSigner": false + }, + { + "name": "gcOracle", + "isMut": true, + "isSigner": false + }, + { + "name": "oracleQueue", + "isMut": true, + "isSigner": false + }, + { + "name": "permission", + "isMut": false, + "isSigner": false + }, + { + "name": "dataBuffer", + "isMut": true, + "isSigner": false + }, + { + "name": "quote", + "isMut": false, + "isSigner": true + }, + { + "name": "programState", + "isMut": false, + "isSigner": false + } + ], + "args": [ + { + "name": "params", + "type": { + "defined": "OracleTeeHeartbeatParams" + } + } + ] + }, { "name": "oracleInit", "accounts": [ @@ -2290,26 +2563,65 @@ "fields": [ { "name": "authority", + "docs": [ + "The account authority permitted to make account changes." + ], "type": "publicKey" }, { "name": "tokenMint", + "docs": [ + "The token mint used for oracle rewards, aggregator leases, and other reward incentives." + ], "type": "publicKey" }, { "name": "tokenVault", + "docs": [ + "Token vault used by the program to receive kickbacks." + ], "type": "publicKey" }, { "name": "daoMint", + "docs": [ + "The token mint used by the DAO." + ], "type": "publicKey" }, + { + "name": "bump", + "docs": [ + "The PDA bump to derive the pubkey." + ], + "type": "u8" + }, + { + "name": "mrEnclaves", + "docs": [ + "Permitted enclave measurements" + ], + "type": { + "array": [ + { + "array": [ + "u8", + 32 + ] + }, + 6 + ] + } + }, { "name": "ebuf", + "docs": [ + "Reserved for future info." + ], "type": { "array": [ "u8", - 992 + 799 ] } } @@ -2337,6 +2649,9 @@ "fields": [ { "name": "name", + "docs": [ + "Name of the aggregator to store on-chain." + ], "type": { "array": [ "u8", @@ -2346,6 +2661,9 @@ }, { "name": "metadata", + "docs": [ + "Metadata of the aggregator to store on-chain." + ], "type": { "array": [ "u8", @@ -2355,6 +2673,9 @@ }, { "name": "reserved1", + "docs": [ + "Reserved." + ], "type": { "array": [ "u8", @@ -2364,72 +2685,121 @@ }, { "name": "queuePubkey", + "docs": [ + "Pubkey of the queue the aggregator belongs to." + ], "type": "publicKey" }, { "name": "oracleRequestBatchSize", + "docs": [ + "CONFIGS", + "Number of oracles assigned to an update request." + ], "type": "u32" }, { "name": "minOracleResults", + "docs": [ + "Minimum number of oracle responses required before a round is validated." + ], "type": "u32" }, { "name": "minJobResults", + "docs": [ + "Minimum number of job results before an oracle accepts a result." + ], "type": "u32" }, { "name": "minUpdateDelaySeconds", + "docs": [ + "Minimum number of seconds required between aggregator rounds." + ], "type": "u32" }, { "name": "startAfter", + "docs": [ + "Unix timestamp for which no feed update will occur before." + ], "type": "i64" }, { "name": "varianceThreshold", + "docs": [ + "Change percentage required between a previous round and the current round. If variance percentage is not met, reject new oracle responses." + ], "type": { "defined": "SwitchboardDecimal" } }, { "name": "forceReportPeriod", + "docs": [ + "Number of seconds for which, even if the variance threshold is not passed, accept new responses from oracles." + ], "type": "i64" }, { "name": "expiration", + "docs": [ + "Timestamp when the feed is no longer needed." + ], "type": "i64" }, { "name": "consecutiveFailureCount", + "docs": [ + "Counter for the number of consecutive failures before a feed is removed from a queue. If set to 0, failed feeds will remain on the queue." + ], "type": "u64" }, { "name": "nextAllowedUpdateTime", + "docs": [ + "Timestamp when the next update request will be available." + ], "type": "i64" }, { "name": "isLocked", + "docs": [ + "Flag for whether an aggregators configuration is locked for editing." + ], "type": "bool" }, { "name": "crankPubkey", + "docs": [ + "Optional, public key of the crank the aggregator is currently using. Event based feeds do not need a crank." + ], "type": "publicKey" }, { "name": "latestConfirmedRound", + "docs": [ + "Latest confirmed update request result that has been accepted as valid." + ], "type": { "defined": "AggregatorRound" } }, { "name": "currentRound", + "docs": [ + "Oracle results from the current round of update request that has not been accepted as valid yet." + ], "type": { "defined": "AggregatorRound" } }, { "name": "jobPubkeysData", + "docs": [ + "List of public keys containing the job definitions for how data is sourced off-chain by oracles." + ], "type": { "array": [ "publicKey", @@ -2439,6 +2809,9 @@ }, { "name": "jobHashes", + "docs": [ + "Used to protect against malicious RPC nodes providing incorrect task definitions to oracles before fulfillment." + ], "type": { "array": [ { @@ -2450,10 +2823,16 @@ }, { "name": "jobPubkeysSize", + "docs": [ + "Number of jobs assigned to an oracle." + ], "type": "u32" }, { "name": "jobsChecksum", + "docs": [ + "Used to protect against malicious RPC nodes providing incorrect task definitions to oracles before fulfillment." + ], "type": { "array": [ "u8", @@ -2463,28 +2842,46 @@ }, { "name": "authority", + "docs": [ + "The account delegated as the authority for making account changes." + ], "type": "publicKey" }, { "name": "historyBuffer", + "docs": [ + "Optional, public key of a history buffer account storing the last N accepted results and their timestamps." + ], "type": "publicKey" }, { "name": "previousConfirmedRoundResult", + "docs": [ + "The previous confirmed round result." + ], "type": { "defined": "SwitchboardDecimal" } }, { "name": "previousConfirmedRoundSlot", + "docs": [ + "The slot when the previous confirmed round was opened." + ], "type": "u64" }, { "name": "disableCrank", + "docs": [ + "Whether an aggregator is permitted to join a crank." + ], "type": "bool" }, { "name": "jobWeights", + "docs": [ + "Job weights used for the weighted median of the aggregator's assigned job accounts." + ], "type": { "array": [ "u8", @@ -2494,10 +2891,17 @@ }, { "name": "creationTimestamp", + "docs": [ + "Unix timestamp when the feed was created." + ], "type": "i64" }, { "name": "resolutionMode", + "docs": [ + "Use sliding window or round based resolution", + "NOTE: This changes result propogation in latest_round_result" + ], "type": { "defined": "AggregatorResolutionMode" } @@ -2520,6 +2924,9 @@ }, { "name": "ebuf", + "docs": [ + "Reserved for future info." + ], "type": { "array": [ "u8", @@ -2569,30 +2976,57 @@ "fields": [ { "name": "authority", + "docs": [ + "The authority that is allowed to set permissions for this account." + ], "type": "publicKey" }, { "name": "permissions", + "docs": [ + "The SwitchboardPermission enumeration assigned by the granter to the grantee." + ], "type": "u32" }, { "name": "granter", + "docs": [ + "Public key of account that is granting permissions to use its resources." + ], "type": "publicKey" }, { "name": "grantee", + "docs": [ + "Public key of account that is being assigned permissions to use a granters resources." + ], "type": "publicKey" }, { "name": "expiration", + "docs": [ + "unused currently. may want permission PDA per permission for", + "unique expiration periods, BUT currently only one permission", + "per account makes sense for the infra. Dont over engineer." + ], "type": "i64" }, + { + "name": "bump", + "docs": [ + "The PDA bump to derive the pubkey." + ], + "type": "u8" + }, { "name": "ebuf", + "docs": [ + "Reserved for future info." + ], "type": { "array": [ "u8", - 256 + 255 ] } } @@ -2618,51 +3052,88 @@ }, { "name": "LeaseAccountData", + "docs": [ + "This should be any ccount that links a permission to an escrow" + ], "type": { "kind": "struct", "fields": [ { "name": "escrow", + "docs": [ + "Public key of the token account holding the lease contract funds until rewarded to oracles for successfully processing updates" + ], "type": "publicKey" }, { "name": "queue", + "docs": [ + "Public key of the oracle queue that the lease contract is applicable for." + ], "type": "publicKey" }, { "name": "aggregator", + "docs": [ + "Public key of the aggregator that the lease contract is applicable for" + ], "type": "publicKey" }, { "name": "tokenProgram", + "docs": [ + "Public key of the Solana token program ID." + ], "type": "publicKey" }, { "name": "isActive", + "docs": [ + "Whether the lease contract is still active." + ], "type": "bool" }, { "name": "crankRowCount", + "docs": [ + "Index of an aggregators position on a crank." + ], "type": "u32" }, { "name": "createdAt", + "docs": [ + "Timestamp when the lease contract was created." + ], "type": "i64" }, { "name": "updateCount", + "docs": [ + "Counter keeping track of the number of updates for the given aggregator." + ], "type": "u128" }, { "name": "withdrawAuthority", + "docs": [ + "Public key of keypair that may withdraw funds from the lease at any time" + ], "type": "publicKey" }, + { + "name": "bump", + "docs": [ + "The PDA bump to derive the pubkey." + ], + "type": "u8" + }, { "name": "ebuf", "type": { "array": [ "u8", - 256 + 255 ] } } @@ -2676,6 +3147,9 @@ "fields": [ { "name": "name", + "docs": [ + "Name of the queue to store on-chain." + ], "type": { "array": [ "u8", @@ -2685,6 +3159,9 @@ }, { "name": "metadata", + "docs": [ + "Metadata of the queue to store on-chain." + ], "type": { "array": [ "u8", @@ -2694,95 +3171,165 @@ }, { "name": "authority", + "docs": [ + "The account delegated as the authority for making account changes or assigning permissions targeted at the queue." + ], "type": "publicKey" }, { "name": "oracleTimeout", + "docs": [ + "Interval when stale oracles will be removed if they fail to heartbeat." + ], "type": "u32" }, { "name": "reward", + "docs": [ + "Rewards to provide oracles and round openers on this queue." + ], "type": "u64" }, { "name": "minStake", + "docs": [ + "The minimum amount of stake oracles must present to remain on the queue." + ], "type": "u64" }, { "name": "slashingEnabled", + "docs": [ + "Whether slashing is enabled on this queue." + ], "type": "bool" }, { "name": "varianceToleranceMultiplier", + "docs": [ + "The tolerated variance amount oracle results can have from the accepted round result before being slashed.", + "slashBound = varianceToleranceMultiplier * stdDeviation Default: 2" + ], "type": { "defined": "SwitchboardDecimal" } }, { "name": "feedProbationPeriod", + "docs": [ + "Number of update rounds new feeds are on probation for.", + "If a feed returns 429s within probation period, auto disable permissions." + ], "type": "u32" }, { "name": "currIdx", + "docs": [ + "Current index of the oracle rotation." + ], "type": "u32" }, { "name": "size", + "docs": [ + "Current number of oracles on a queue." + ], "type": "u32" }, { "name": "gcIdx", + "docs": [ + "Garbage collection index." + ], "type": "u32" }, { "name": "consecutiveFeedFailureLimit", + "docs": [ + "Consecutive failure limit for a feed before feed permission is revoked." + ], "type": "u64" }, { "name": "consecutiveOracleFailureLimit", + "docs": [ + "Consecutive failure limit for an oracle before oracle permission is revoked." + ], "type": "u64" }, { "name": "unpermissionedFeedsEnabled", + "docs": [ + "Enabling this setting means data feeds do not need explicit permission to join the queue and request new values from its oracles." + ], "type": "bool" }, { "name": "unpermissionedVrfEnabled", + "docs": [ + "Enabling this setting means VRF accounts do not need explicit permission to join the queue and request new values from its oracles." + ], "type": "bool" }, { "name": "curatorRewardCut", + "docs": [ + "TODO: Revenue percentage rewarded to job curators overall." + ], "type": { "defined": "SwitchboardDecimal" } }, { "name": "lockLeaseFunding", + "docs": [ + "Prevent new leases from being funded n this queue.", + "Useful to turn down a queue for migrations, since authority is always immutable." + ], "type": "bool" }, { "name": "mint", + "docs": [ + "Token mint used for the oracle queue rewards and slashing." + ], "type": "publicKey" }, { "name": "enableBufferRelayers", + "docs": [ + "Whether oracles are permitted to fulfill buffer relayer update request." + ], + "type": "bool" + }, + { + "name": "enableTeeOnly", "type": "bool" }, { "name": "ebuf", + "docs": [ + "Reserved for future info." + ], "type": { "array": [ "u8", - 968 + 967 ] } }, { "name": "maxSize", + "docs": [ + "Maximum number of oracles a queue can support." + ], "type": "u32" }, { "name": "dataBuffer", + "docs": [ + "The public key of the OracleQueueBuffer account holding a collection of Oracle pubkeys that haver successfully heartbeated before the queues `oracleTimeout`." + ], "type": "publicKey" } ] @@ -2795,6 +3342,9 @@ "fields": [ { "name": "name", + "docs": [ + "Name of the crank to store on-chain." + ], "type": { "array": [ "u8", @@ -2804,6 +3354,9 @@ }, { "name": "metadata", + "docs": [ + "Metadata of the crank to store on-chain." + ], "type": { "array": [ "u8", @@ -2813,22 +3366,37 @@ }, { "name": "queuePubkey", + "docs": [ + "Public key of the oracle queue who owns the crank." + ], "type": "publicKey" }, { "name": "pqSize", + "docs": [ + "Number of aggregators added to the crank." + ], "type": "u32" }, { "name": "maxRows", + "docs": [ + "Maximum number of aggregators allowed to be added to a crank." + ], "type": "u32" }, { "name": "jitterModifier", + "docs": [ + "Pseudorandom value added to next aggregator update time." + ], "type": "u8" }, { "name": "ebuf", + "docs": [ + "Reserved for future info." + ], "type": { "array": [ "u8", @@ -2838,6 +3406,9 @@ }, { "name": "dataBuffer", + "docs": [ + "The public key of the CrankBuffer account holding a collection of Aggregator pubkeys and their next allowed update time." + ], "type": "publicKey" } ] @@ -2850,6 +3421,9 @@ "fields": [ { "name": "name", + "docs": [ + "Name of the oracle to store on-chain." + ], "type": { "array": [ "u8", @@ -2859,6 +3433,9 @@ }, { "name": "metadata", + "docs": [ + "Metadata of the oracle to store on-chain." + ], "type": { "array": [ "u8", @@ -2868,36 +3445,64 @@ }, { "name": "oracleAuthority", + "docs": [ + "The account delegated as the authority for making account changes or withdrawing funds from a staking wallet." + ], "type": "publicKey" }, { "name": "lastHeartbeat", + "docs": [ + "Unix timestamp when the oracle last heartbeated" + ], "type": "i64" }, { "name": "numInUse", + "docs": [ + "Flag dictating if an oracle is active and has heartbeated before the queue's oracle timeout parameter." + ], "type": "u32" }, { "name": "tokenAccount", + "docs": [ + "Stake account and reward/slashing wallet." + ], "type": "publicKey" }, { "name": "queuePubkey", + "docs": [ + "Public key of the oracle queue who has granted it permission to use its resources." + ], "type": "publicKey" }, { "name": "metrics", + "docs": [ + "Oracle track record." + ], "type": { "defined": "OracleMetrics" } }, + { + "name": "bump", + "docs": [ + "The PDA bump to derive the pubkey." + ], + "type": "u8" + }, { "name": "ebuf", + "docs": [ + "Reserved for future info." + ], "type": { "array": [ "u8", - 256 + 255 ] } } @@ -2911,6 +3516,9 @@ "fields": [ { "name": "name", + "docs": [ + "Name of the job to store on-chain." + ], "type": { "array": [ "u8", @@ -2920,6 +3528,9 @@ }, { "name": "metadata", + "docs": [ + "Metadata of the job to store on-chain." + ], "type": { "array": [ "u8", @@ -2929,14 +3540,23 @@ }, { "name": "authority", + "docs": [ + "The account delegated as the authority for making account changes." + ], "type": "publicKey" }, { "name": "expiration", + "docs": [ + "Unix timestamp when the job is considered invalid" + ], "type": "i64" }, { "name": "hash", + "docs": [ + "Hash of the serialized data to prevent tampering." + ], "type": { "array": [ "u8", @@ -2946,18 +3566,30 @@ }, { "name": "data", + "docs": [ + "Serialized protobuf containing the collection of task to retrieve data off-chain." + ], "type": "bytes" }, { "name": "referenceCount", + "docs": [ + "The number of data feeds referencing the job account.." + ], "type": "u32" }, { "name": "totalSpent", + "docs": [ + "The token amount funded into a feed that contains this job account." + ], "type": "u64" }, { "name": "createdAt", + "docs": [ + "Unix timestamp when the job was created on-chain." + ], "type": "i64" }, { @@ -2974,38 +3606,62 @@ "fields": [ { "name": "status", + "docs": [ + "The current status of the VRF account." + ], "type": { "defined": "VrfStatus" } }, { "name": "counter", + "docs": [ + "Incremental counter for tracking VRF rounds." + ], "type": "u128" }, { "name": "authority", + "docs": [ + "On-chain account delegated for making account changes." + ], "type": "publicKey" }, { "name": "oracleQueue", + "docs": [ + "The OracleQueueAccountData that is assigned to fulfill VRF update request." + ], "type": "publicKey" }, { "name": "escrow", + "docs": [ + "The token account used to hold funds for VRF update request." + ], "type": "publicKey" }, { "name": "callback", + "docs": [ + "The callback that is invoked when an update request is successfully verified." + ], "type": { "defined": "CallbackZC" } }, { "name": "batchSize", + "docs": [ + "The number of oracles assigned to a VRF update request." + ], "type": "u32" }, { "name": "builders", + "docs": [ + "Struct containing the intermediate state between VRF crank actions." + ], "type": { "array": [ { @@ -3017,6 +3673,9 @@ }, { "name": "buildersLen", + "docs": [ + "The number of builders." + ], "type": "u32" }, { @@ -3025,12 +3684,18 @@ }, { "name": "currentRound", + "docs": [ + "Oracle results from the current round of update request that has not been accepted as valid yet" + ], "type": { "defined": "VrfRound" } }, { "name": "ebuf", + "docs": [ + "Reserved for future info." + ], "type": { "array": [ "u8", @@ -3048,24 +3713,39 @@ "fields": [ { "name": "stateBump", + "docs": [ + "The bump used to derive the SbState account." + ], "type": "u8" }, { "name": "permissionBump", + "docs": [ + "The bump used to derive the permission account." + ], "type": "u8" }, { "name": "vrfPool", + "docs": [ + "The VrfPool the account belongs to." + ], "type": "publicKey" }, { "name": "status", + "docs": [ + "The current status of the VRF account." + ], "type": { "defined": "VrfStatus" } }, { "name": "result", + "docs": [ + "The VRF round result. Will be zeroized if still awaiting fulfillment." + ], "type": { "array": [ "u8", @@ -3075,10 +3755,16 @@ }, { "name": "counter", + "docs": [ + "Incremental counter for tracking VRF rounds." + ], "type": "u128" }, { "name": "alpha", + "docs": [ + "The alpha bytes used to calculate the VRF proof." + ], "type": { "array": [ "u8", @@ -3088,36 +3774,60 @@ }, { "name": "alphaLen", + "docs": [ + "The number of bytes in the alpha buffer." + ], "type": "u32" }, { "name": "requestSlot", + "docs": [ + "The Slot when the VRF round was opened." + ], "type": "u64" }, { "name": "requestTimestamp", + "docs": [ + "The unix timestamp when the VRF round was opened." + ], "type": "i64" }, { "name": "authority", + "docs": [ + "On-chain account delegated for making account changes." + ], "type": "publicKey" }, { "name": "queue", + "docs": [ + "The OracleQueueAccountData that is assigned to fulfill VRF update request." + ], "type": "publicKey" }, { "name": "escrow", + "docs": [ + "The token account used to hold funds for VRF update request." + ], "type": "publicKey" }, { "name": "callback", + "docs": [ + "The callback that is invoked when an update request is successfully verified." + ], "type": { "defined": "CallbackZC" } }, { "name": "builder", + "docs": [ + "The incremental VRF proof calculation." + ], "type": { "defined": "VrfBuilder" } @@ -3145,6 +3855,9 @@ "fields": [ { "name": "authority", + "docs": [ + "ACCOUNTS" + ], "type": "publicKey" }, { @@ -3194,6 +3907,9 @@ "fields": [ { "name": "name", + "docs": [ + "Name of the buffer account to store on-chain." + ], "type": { "array": [ "u8", @@ -3203,22 +3919,37 @@ }, { "name": "queuePubkey", + "docs": [ + "Public key of the OracleQueueAccountData that is currently assigned to fulfill buffer relayer update request." + ], "type": "publicKey" }, { "name": "escrow", + "docs": [ + "Token account to reward oracles for completing update request." + ], "type": "publicKey" }, { "name": "authority", + "docs": [ + "The account delegated as the authority for making account changes." + ], "type": "publicKey" }, { "name": "jobPubkey", + "docs": [ + "Public key of the JobAccountData that defines how the buffer relayer is updated." + ], "type": "publicKey" }, { "name": "jobHash", + "docs": [ + "Used to protect against malicious RPC nodes providing incorrect task definitions to oracles before fulfillment" + ], "type": { "array": [ "u8", @@ -3228,26 +3959,41 @@ }, { "name": "minUpdateDelaySeconds", + "docs": [ + "Minimum delay between update request." + ], "type": "u32" }, { "name": "isLocked", + "docs": [ + "Whether buffer relayer config is locked for further changes." + ], "type": "bool" }, { "name": "currentRound", + "docs": [ + "The current buffer relayer update round that is yet to be confirmed." + ], "type": { "defined": "BufferRelayerRound" } }, { "name": "latestConfirmedRound", + "docs": [ + "The latest confirmed buffer relayer update round." + ], "type": { "defined": "BufferRelayerRound" } }, { "name": "result", + "docs": [ + "The buffer holding the latest confirmed result." + ], "type": "bytes" } ] @@ -3269,6 +4015,26 @@ ] } }, + { + "name": "AggregatorCloseParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "stateBump", + "type": "u8" + }, + { + "name": "permissionBump", + "type": "u8" + }, + { + "name": "leaseBump", + "type": "u8" + } + ] + } + }, { "name": "AggregatorInitParams", "type": { @@ -3615,6 +4381,12 @@ "type": { "option": "u32" } + }, + { + "name": "disableCrank", + "type": { + "option": "bool" + } } ] } @@ -3694,15 +4466,66 @@ } }, { - "name": "AggregatorSetVarianceThresholdParams", + "name": "AggregatorSetVarianceThresholdParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "varianceThreshold", + "type": { + "defined": "BorshDecimal" + } + } + ] + } + }, + { + "name": "AggregatorTeeSaveResultParams", "type": { "kind": "struct", "fields": [ { - "name": "varianceThreshold", + "name": "value", + "type": { + "defined": "BorshDecimal" + } + }, + { + "name": "jobsChecksum", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "minResponse", + "type": { + "defined": "BorshDecimal" + } + }, + { + "name": "maxResponse", "type": { "defined": "BorshDecimal" } + }, + { + "name": "feedPermissionBump", + "type": "u8" + }, + { + "name": "oraclePermissionBump", + "type": "u8" + }, + { + "name": "leaseBump", + "type": "u8" + }, + { + "name": "stateBump", + "type": "u8" } ] } @@ -4127,6 +4950,10 @@ { "name": "enableBufferRelayers", "type": "bool" + }, + { + "name": "enableTeeOnly", + "type": "bool" } ] } @@ -4219,6 +5046,12 @@ "type": { "option": "u64" } + }, + { + "name": "enableTeeOnly", + "type": { + "option": "bool" + } } ] } @@ -4235,6 +5068,18 @@ ] } }, + { + "name": "OracleTeeHeartbeatParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "permissionBump", + "type": "u8" + } + ] + } + }, { "name": "OracleWithdrawParams", "type": { @@ -4296,6 +5141,28 @@ { "name": "daoMint", "type": "publicKey" + }, + { + "name": "addEnclaves", + "type": { + "vec": { + "array": [ + "u8", + 32 + ] + } + } + }, + { + "name": "rmEnclaves", + "type": { + "vec": { + "array": [ + "u8", + 32 + ] + } + } } ] } @@ -4312,6 +5179,18 @@ ] } }, + { + "name": "SetBumpsParams", + "type": { + "kind": "struct", + "fields": [ + { + "name": "stateBump", + "type": "u8" + } + ] + } + }, { "name": "VaultTransferParams", "type": { @@ -4619,11 +5498,26 @@ }, { "name": "Scalar", + "docs": [ + "The `Scalar` struct holds an integer \\\\(s < 2\\^{255} \\\\) which", + "represents an element of \\\\(\\mathbb Z / \\ell\\\\)." + ], "type": { "kind": "struct", "fields": [ { "name": "bytes", + "docs": [ + "`bytes` is a little-endian byte encoding of an integer representing a scalar modulo the", + "group order.", + "", + "# Invariant", + "", + "The integer representing this scalar must be bounded above by \\\\(2\\^{255}\\\\), or", + "equivalently the high bit of `bytes[31]` must be zero.", + "", + "This ensures that there is room for a carry bit when computing a NAF representation." + ], "type": { "array": [ "u8", @@ -4795,6 +5689,170 @@ ] } }, + { + "name": "Quote", + "type": { + "kind": "struct", + "fields": [ + { + "name": "enclaveSigner", + "docs": [ + "The address of the signer generated within an enclave." + ], + "type": "publicKey" + }, + { + "name": "mrEnclave", + "docs": [ + "The quotes MRENCLAVE measurement dictating the contents of the secure enclave." + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "verificationStatus", + "docs": [ + "The VerificationStatus of the quote." + ], + "type": "u8" + }, + { + "name": "verificationTimestamp", + "docs": [ + "The unix timestamp when the quote was last verified." + ], + "type": "i64" + }, + { + "name": "validUntil", + "docs": [ + "The unix timestamp when the quotes verification status expires." + ], + "type": "i64" + }, + { + "name": "quoteRegistry", + "docs": [ + "The off-chain registry where the verifiers quote can be located." + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "registryKey", + "docs": [ + "Key to lookup the buffer data on IPFS or an alternative decentralized storage solution." + ], + "type": { + "array": [ + "u8", + 64 + ] + } + }, + { + "name": "ebuf", + "docs": [ + "Reserved." + ], + "type": { + "array": [ + "u8", + 256 + ] + } + } + ] + } + }, + { + "name": "VerifierAccountData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "enclave", + "docs": [ + "Represents the state of the quote verifiers enclave." + ], + "type": { + "defined": "Quote" + } + }, + { + "name": "authority", + "docs": [ + "The authority of the EnclaveAccount which is permitted to make account changes." + ], + "type": "publicKey" + }, + { + "name": "attestationQueue", + "docs": [ + "Queue used for attestation to verify a MRENCLAVE measurement." + ], + "type": "publicKey" + }, + { + "name": "createdAt", + "docs": [ + "The unix timestamp when the quote was created." + ], + "type": "i64" + }, + { + "name": "isOnQueue", + "docs": [ + "Whether the quote is located on the AttestationQueues buffer." + ], + "type": "bool" + }, + { + "name": "lastHeartbeat", + "docs": [ + "The last time the quote heartbeated on-chain." + ], + "type": "i64" + }, + { + "name": "rewardEscrow", + "docs": [ + "The SwitchboardWallet account containing the reward escrow for verifying quotes on-chain.", + "We should set this whenever the operator changes so we dont need to pass another account and can verify with has_one." + ], + "type": "publicKey" + }, + { + "name": "stakeWallet", + "docs": [ + "The SwitchboardWallet account containing the queues required min_stake.", + "Needs to be separate from the reward_escrow. Allows easier 3rd party management of stake from rewards." + ], + "type": "publicKey" + }, + { + "name": "ebuf", + "docs": [ + "Reserved." + ], + "type": { + "array": [ + "u8", + 1024 + ] + } + } + ] + } + }, { "name": "Hash", "type": { @@ -4802,6 +5860,9 @@ "fields": [ { "name": "data", + "docs": [ + "The bytes used to derive the hash." + ], "type": { "array": [ "u8", @@ -4845,50 +5906,81 @@ "fields": [ { "name": "numSuccess", + "docs": [ + "Maintains the number of successful responses received from nodes.", + "Nodes can submit one successful response per round." + ], "type": "u32" }, { "name": "numError", + "docs": [ + "Number of error responses." + ], "type": "u32" }, { "name": "isClosed", + "docs": [ + "Whether an update request round has ended." + ], "type": "bool" }, { "name": "roundOpenSlot", + "docs": [ + "Maintains the `solana_program::clock::Slot` that the round was opened at." + ], "type": "u64" }, { "name": "roundOpenTimestamp", + "docs": [ + "Maintains the `solana_program::clock::UnixTimestamp;` the round was opened at." + ], "type": "i64" }, { "name": "result", + "docs": [ + "Maintains the current median of all successful round responses." + ], "type": { "defined": "SwitchboardDecimal" } }, { "name": "stdDeviation", + "docs": [ + "Standard deviation of the accepted results in the round." + ], "type": { "defined": "SwitchboardDecimal" } }, { "name": "minResponse", + "docs": [ + "Maintains the minimum node response this round." + ], "type": { "defined": "SwitchboardDecimal" } }, { "name": "maxResponse", + "docs": [ + "Maintains the maximum node response this round." + ], "type": { "defined": "SwitchboardDecimal" } }, { "name": "oraclePubkeysData", + "docs": [ + "Pubkeys of the oracles fulfilling this round." + ], "type": { "array": [ "publicKey", @@ -4898,6 +5990,9 @@ }, { "name": "mediansData", + "docs": [ + "Represents all successful node responses this round. `NaN` if empty." + ], "type": { "array": [ { @@ -4909,6 +6004,9 @@ }, { "name": "currentPayout", + "docs": [ + "Current rewards/slashes oracles have received this round." + ], "type": { "array": [ "i64", @@ -4918,6 +6016,9 @@ }, { "name": "mediansFulfilled", + "docs": [ + "Keep track of which responses are fulfilled here." + ], "type": { "array": [ "bool", @@ -4927,6 +6028,9 @@ }, { "name": "errorsFulfilled", + "docs": [ + "Keeps track of which errors are fulfilled here." + ], "type": { "array": [ "bool", @@ -4944,10 +6048,16 @@ "fields": [ { "name": "timestamp", + "docs": [ + "The timestamp of the sample." + ], "type": "i64" }, { "name": "value", + "docs": [ + "The value of the sample." + ], "type": { "defined": "SwitchboardDecimal" } @@ -4962,10 +6072,17 @@ "fields": [ { "name": "mantissa", + "docs": [ + "The part of a floating-point number that represents the significant digits of that number,", + "and that is multiplied by the base, 10, raised to the power of scale to give the actual value of the number." + ], "type": "i128" }, { "name": "scale", + "docs": [ + "The number of decimal places to move to the left to yield the actual value." + ], "type": "u32" } ] @@ -4978,10 +6095,16 @@ "fields": [ { "name": "pubkey", + "docs": [ + "The PublicKey of the AggregatorAccountData." + ], "type": "publicKey" }, { "name": "nextTimestamp", + "docs": [ + "The aggregator's next available update time." + ], "type": "i64" } ] @@ -4994,38 +6117,65 @@ "fields": [ { "name": "consecutiveSuccess", + "docs": [ + "Number of consecutive successful update request." + ], "type": "u64" }, { "name": "consecutiveError", + "docs": [ + "Number of consecutive update request that resulted in an error." + ], "type": "u64" }, { "name": "consecutiveDisagreement", + "docs": [ + "Number of consecutive update request that resulted in a disagreement with the accepted median result." + ], "type": "u64" }, { "name": "consecutiveLateResponse", + "docs": [ + "Number of consecutive update request that were posted on-chain late and not included in an accepted result." + ], "type": "u64" }, { "name": "consecutiveFailure", + "docs": [ + "Number of consecutive update request that resulted in a failure." + ], "type": "u64" }, { "name": "totalSuccess", + "docs": [ + "Total number of successful update request." + ], "type": "u128" }, { "name": "totalError", + "docs": [ + "Total number of update request that resulted in an error." + ], "type": "u128" }, { "name": "totalDisagreement", + "docs": [ + "Total number of update request that resulted in a disagreement with the accepted median result." + ], "type": "u128" }, { "name": "totalLateResponse", + "docs": [ + "Total number of update request that were posted on-chain late and not included in an accepted result." + ], "type": "u128" } ] @@ -5038,16 +6188,25 @@ "fields": [ { "name": "producer", + "docs": [ + "The OracleAccountData that is producing the randomness." + ], "type": "publicKey" }, { "name": "status", + "docs": [ + "The current status of the VRF verification." + ], "type": { "defined": "VrfStatus" } }, { "name": "reprProof", + "docs": [ + "The VRF proof sourced from the producer." + ], "type": { "array": [ "u8", @@ -5261,14 +6420,23 @@ }, { "name": "txRemaining", + "docs": [ + "The number of transactions remaining to verify the VRF proof." + ], "type": "u32" }, { "name": "verified", + "docs": [ + "Whether the VRF proof has been verified on-chain." + ], "type": "bool" }, { "name": "result", + "docs": [ + "The VRF proof verification result. Will be zeroized if still awaiting fulfillment." + ], "type": { "array": [ "u8", @@ -5326,10 +6494,16 @@ "fields": [ { "name": "programId", + "docs": [ + "The program ID of the callback program being invoked." + ], "type": "publicKey" }, { "name": "accounts", + "docs": [ + "The accounts being used in the callback instruction." + ], "type": { "array": [ { @@ -5341,10 +6515,16 @@ }, { "name": "accountsLen", + "docs": [ + "The number of accounts used in the callback" + ], "type": "u32" }, { "name": "ixData", + "docs": [ + "The serialized instruction data." + ], "type": { "array": [ "u8", @@ -5354,6 +6534,9 @@ }, { "name": "ixDataLen", + "docs": [ + "The number of serialized bytes in the instruction data." + ], "type": "u32" } ] @@ -5366,6 +6549,9 @@ "fields": [ { "name": "alpha", + "docs": [ + "The alpha bytes used to calculate the VRF proof." + ], "type": { "array": [ "u8", @@ -5375,18 +6561,30 @@ }, { "name": "alphaLen", + "docs": [ + "The number of bytes in the alpha buffer." + ], "type": "u32" }, { "name": "requestSlot", + "docs": [ + "The Slot when the VRF round was opened." + ], "type": "u64" }, { "name": "requestTimestamp", + "docs": [ + "The unix timestamp when the VRF round was opened." + ], "type": "i64" }, { "name": "result", + "docs": [ + "The VRF round result. Will be zeroized if still awaiting fulfillment." + ], "type": { "array": [ "u8", @@ -5396,10 +6594,16 @@ }, { "name": "numVerified", + "docs": [ + "The number of builders who verified the VRF proof." + ], "type": "u32" }, { "name": "ebuf", + "docs": [ + "Reserved for future info." + ], "type": { "array": [ "u8", @@ -5433,22 +6637,37 @@ "fields": [ { "name": "numSuccess", + "docs": [ + "Number of successful responses." + ], "type": "u32" }, { "name": "numError", + "docs": [ + "Number of error responses." + ], "type": "u32" }, { "name": "roundOpenSlot", + "docs": [ + "Slot when the buffer relayer round was opened." + ], "type": "u64" }, { "name": "roundOpenTimestamp", + "docs": [ + "Timestamp when the buffer relayer round was opened." + ], "type": "i64" }, { "name": "oraclePubkey", + "docs": [ + "The public key of the oracle fulfilling the buffer relayer update request." + ], "type": "publicKey" } ] @@ -5456,6 +6675,14 @@ }, { "name": "Lanes", + "docs": [ + "The `Lanes` enum represents a subset of the lanes `A,B,C,D` of a", + "`FieldElement2625x4`.", + "", + "It's used to specify blend operations without", + "having to know details about the data layout of the", + "`FieldElement2625x4`." + ], "type": { "kind": "enum", "variants": [ @@ -5488,6 +6715,13 @@ }, { "name": "Shuffle", + "docs": [ + "The `Shuffle` enum represents a shuffle of a `FieldElement2625x4`.", + "", + "The enum variants are named by what they do to a vector \\\\(", + "(A,B,C,D) \\\\); for instance, `Shuffle::BADC` turns \\\\( (A, B, C,", + "D) \\\\) into \\\\( (B, A, D, C) \\\\)." + ], "type": { "kind": "enum", "variants": [ @@ -5608,6 +6842,29 @@ ] } }, + { + "name": "VerificationStatus", + "type": { + "kind": "enum", + "variants": [ + { + "name": "None" + }, + { + "name": "VerificationPending" + }, + { + "name": "VerificationFailure" + }, + { + "name": "VerificationSuccess" + }, + { + "name": "VerificationOverride" + } + ] + } + }, { "name": "AggregatorResolutionMode", "type": { @@ -5883,6 +7140,38 @@ } ] }, + { + "name": "AggregatorTeeSaveResultEvent", + "fields": [ + { + "name": "feedPubkey", + "type": "publicKey", + "index": false + }, + { + "name": "value", + "type": { + "defined": "BorshDecimal" + }, + "index": false + }, + { + "name": "slot", + "type": "u64", + "index": false + }, + { + "name": "timestamp", + "type": "i64", + "index": false + }, + { + "name": "oraclePubkey", + "type": "publicKey", + "index": false + } + ] + }, { "name": "AggregatorValueUpdateEvent", "fields": [ @@ -6436,6 +7725,16 @@ "index": false } ] + }, + { + "name": "QuoteVerifyRequestEvent", + "fields": [ + { + "name": "quotePubkey", + "type": "publicKey", + "index": false + } + ] } ], "errors": [ @@ -6938,6 +8237,26 @@ "code": 6099, "name": "InsufficientTokenBalance", "msg": "Escrow has insufficient funds to perform this action." + }, + { + "code": 6100, + "name": "InvalidQuoteError", + "msg": "Invalid SAS quote account" + }, + { + "code": 6101, + "name": "InvalidHistoryAccountError", + "msg": "" + }, + { + "code": 6102, + "name": "GenericError", + "msg": "" + }, + { + "code": 6103, + "name": "InvalidAuthorityState", + "msg": "" } ] } \ No newline at end of file diff --git a/javascript/solana.js/package.json b/javascript/solana.js/package.json index f8b2748d1..edadb8b12 100644 --- a/javascript/solana.js/package.json +++ b/javascript/solana.js/package.json @@ -1,6 +1,6 @@ { "name": "@switchboard-xyz/solana.js", - "version": "2.5.6", + "version": "2.6.2", "author": "", "license": "MIT", "description": "A Typescript client to interact with Switchboard on Solana.", @@ -29,7 +29,7 @@ "@coral-xyz/borsh": "^0.28.0", "@solana/spl-token": "^0.3.8", "@solana/web3.js": "^1.78.3", - "@switchboard-xyz/common": "^2.3.3", + "@switchboard-xyz/common": "^2.3.6", "cron-validator": "^1.3.1", "dotenv": "^16.3.1", "lodash": "^4.17.21" diff --git a/javascript/solana.js/src/accounts/functionAccount.ts b/javascript/solana.js/src/accounts/functionAccount.ts index dbdab3684..63875d5d0 100644 --- a/javascript/solana.js/src/accounts/functionAccount.ts +++ b/javascript/solana.js/src/accounts/functionAccount.ts @@ -9,6 +9,7 @@ import type { } from "../TransactionObject.js"; import { TransactionObject } from "../TransactionObject.js"; import { + containsMrEnclave, handleOptionalPubkeys, numToBN, parseCronSchedule, @@ -225,10 +226,14 @@ export class FunctionAccount extends Account { creatorSeed: Uint8Array, recentSlot: BN ): FunctionAccount { + if (creatorSeed.length > 32) { + throw new Error("Creator seed must be 32 bytes or less"); + } + const functionPubkey = anchor.web3.PublicKey.findProgramAddressSync( [ Buffer.from("FunctionAccountData"), - creatorSeed, + creatorSeed.length < 32 ? parseRawBuffer(creatorSeed, 32) : creatorSeed, recentSlot.toBuffer("le", 8), ], program.attestationProgramId @@ -284,10 +289,12 @@ export class FunctionAccount extends Account { throw new errors.AccountNotFoundError("Function", PublicKey.default); } + assert(data.creatorSeed.length === 32); + const functionAccount = FunctionAccount.fromSeed( program, new Uint8Array(data.creatorSeed), - data.createdAt + data.createdAtSlot ); functionAccount._wallet = Promise.resolve( @@ -556,6 +563,138 @@ export class FunctionAccount extends Account { ).then((txn) => this.program.signAndSend(txn, options)); } + public static hasMrEnclave( + mrEnclaves: Array, + targetMrEnclave: number[] | Uint8Array + ): boolean { + return containsMrEnclave(mrEnclaves, targetMrEnclave); + } + + public async addMrEnclaveInstruction( + payer: PublicKey, + mrEnclave: number[] | Uint8Array, + params?: { + // Optional authority if needing to change config and payer is not the authority + authority?: Keypair; + // Pre-fetched account state to reduce network calls + functionState?: types.FunctionAccountData; + // Force remove a MrEnclave if full + force?: boolean; + }, + options?: TransactionObjectOptions + ): Promise { + const force = params?.force ?? false; + const functionState = params?.functionState ?? (await this.loadData()); + + if (FunctionAccount.hasMrEnclave(functionState.mrEnclaves, mrEnclave)) { + throw new errors.FunctionMrEnclaveAlreadySet(); + } + + const filteredMrEnclaves = functionState.mrEnclaves.filter( + (arr) => !arr.every((num) => num === 0) + ); + if (filteredMrEnclaves.length >= 32 && !force) { + throw new errors.FunctionMrEnclavesFull(); + } + + const newMrEnclaves = [ + ...(filteredMrEnclaves.length >= 32 + ? filteredMrEnclaves.slice(filteredMrEnclaves.length - 32 + 1) + : filteredMrEnclaves), + Array.from(mrEnclave), + ]; + + if (params?.authority) { + if (!params.authority.publicKey.equals(functionState.authority)) { + throw new errors.IncorrectAuthority( + functionState.authority, + params.authority.publicKey + ); + } + } else { + if (!payer.equals(functionState.authority)) { + throw new errors.IncorrectAuthority(functionState.authority, payer); + } + } + + const setConfigIxn = types.functionSetConfig( + this.program, + { + params: { + name: null, + metadata: null, + container: null, + containerRegistry: null, + version: null, + schedule: null, + mrEnclaves: newMrEnclaves, + requestsDisabled: null, + requestsRequireAuthorization: null, + requestsFee: null, + }, + }, + { + function: this.publicKey, + authority: functionState.authority, + } + ); + + return new TransactionObject( + payer, + [setConfigIxn], + params?.authority ? [params.authority] : [], + options + ); + } + + public async addMrEnclave( + mrEnclave: number[] | Uint8Array, + params?: { + // Optional authority if needing to change config and payer is not the authority + authority?: Keypair; + // Pre-fetched account state to reduce network calls + functionState?: types.FunctionAccountData; + // Force remove a MrEnclave if full + force?: boolean; + }, + options?: SendTransactionObjectOptions + ): Promise { + return await this.addMrEnclaveInstruction( + this.program.walletPubkey, + mrEnclave, + params, + options + ).then((txn) => this.program.signAndSend(txn, options)); + } + + /** + * Try to add a MrEnclave to the function config, if it is not already present. Returns undefined + * if MrEnclave is already in the config. + */ + public async tryAddMrEnclave( + mrEnclave: number[] | Uint8Array, + params?: { + // Optional authority if needing to change config and payer is not the authority + authority?: Keypair; + // Pre-fetched account state to reduce network calls + functionState?: types.FunctionAccountData; + // Force remove a MrEnclave if full + force?: boolean; + }, + options?: SendTransactionObjectOptions + ): Promise { + const functionState = params?.functionState ?? (await this.loadData()); + if (FunctionAccount.hasMrEnclave(functionState.mrEnclaves, mrEnclave)) { + return undefined; + } + return await this.addMrEnclaveInstruction( + this.program.walletPubkey, + mrEnclave, + params, + options + ).then((txn) => this.program.signAndSend(txn, options)); + } + public async setEscrowInstruction( payer: PublicKey, params: FunctionSetEscrowParams, diff --git a/javascript/solana.js/src/errors.ts b/javascript/solana.js/src/errors.ts index fa6174d2f..3fb399dff 100644 --- a/javascript/solana.js/src/errors.ts +++ b/javascript/solana.js/src/errors.ts @@ -106,6 +106,24 @@ export class InvalidCronSchedule extends Error { super( `invalid cron schedule, expected format: '* * * * * *', received: ${schedule}` ); - Object.setPrototypeOf(this, IncorrectOwner.prototype); + Object.setPrototypeOf(this, InvalidCronSchedule.prototype); + } +} + +export class FunctionMrEnclaveAlreadySet extends Error { + constructor() { + super( + `Function already has this mrEnclave in its config, no action needed` + ); + Object.setPrototypeOf(this, FunctionMrEnclaveAlreadySet.prototype); + } +} + +export class FunctionMrEnclavesFull extends Error { + constructor() { + super( + `Function already has the maximum number of mrEnclaves in its config - try removing one or using force to remove the first MrEnclave in its config` + ); + Object.setPrototypeOf(this, FunctionMrEnclavesFull.prototype); } } diff --git a/javascript/solana.js/src/generated/attestation-program/types/FunctionStatus.ts b/javascript/solana.js/src/generated/attestation-program/types/FunctionStatus.ts index 9c169a9aa..ba6c7f846 100644 --- a/javascript/solana.js/src/generated/attestation-program/types/FunctionStatus.ts +++ b/javascript/solana.js/src/generated/attestation-program/types/FunctionStatus.ts @@ -74,14 +74,37 @@ export class NonExecutable { } } +export interface None3JSON { + kind: "None3"; +} + +export class None3 { + static readonly discriminator = 3; + static readonly kind = "None3"; + readonly discriminator = 3; + readonly kind = "None3"; + + toJSON(): None3JSON { + return { + kind: "None3", + }; + } + + toEncodable() { + return { + None3: {}, + }; + } +} + export interface ExpiredJSON { kind: "Expired"; } export class Expired { - static readonly discriminator = 3; + static readonly discriminator = 4; static readonly kind = "Expired"; - readonly discriminator = 3; + readonly discriminator = 4; readonly kind = "Expired"; toJSON(): ExpiredJSON { @@ -97,14 +120,83 @@ export class Expired { } } +export interface None5JSON { + kind: "None5"; +} + +export class None5 { + static readonly discriminator = 5; + static readonly kind = "None5"; + readonly discriminator = 5; + readonly kind = "None5"; + + toJSON(): None5JSON { + return { + kind: "None5", + }; + } + + toEncodable() { + return { + None5: {}, + }; + } +} + +export interface None6JSON { + kind: "None6"; +} + +export class None6 { + static readonly discriminator = 6; + static readonly kind = "None6"; + readonly discriminator = 6; + readonly kind = "None6"; + + toJSON(): None6JSON { + return { + kind: "None6", + }; + } + + toEncodable() { + return { + None6: {}, + }; + } +} + +export interface None7JSON { + kind: "None7"; +} + +export class None7 { + static readonly discriminator = 7; + static readonly kind = "None7"; + readonly discriminator = 7; + readonly kind = "None7"; + + toJSON(): None7JSON { + return { + kind: "None7", + }; + } + + toEncodable() { + return { + None7: {}, + }; + } +} + export interface OutOfFundsJSON { kind: "OutOfFunds"; } export class OutOfFunds { - static readonly discriminator = 4; + static readonly discriminator = 8; static readonly kind = "OutOfFunds"; - readonly discriminator = 4; + readonly discriminator = 8; readonly kind = "OutOfFunds"; toJSON(): OutOfFundsJSON { @@ -120,14 +212,175 @@ export class OutOfFunds { } } +export interface None9JSON { + kind: "None9"; +} + +export class None9 { + static readonly discriminator = 9; + static readonly kind = "None9"; + readonly discriminator = 9; + readonly kind = "None9"; + + toJSON(): None9JSON { + return { + kind: "None9", + }; + } + + toEncodable() { + return { + None9: {}, + }; + } +} + +export interface None10JSON { + kind: "None10"; +} + +export class None10 { + static readonly discriminator = 10; + static readonly kind = "None10"; + readonly discriminator = 10; + readonly kind = "None10"; + + toJSON(): None10JSON { + return { + kind: "None10", + }; + } + + toEncodable() { + return { + None10: {}, + }; + } +} + +export interface None11JSON { + kind: "None11"; +} + +export class None11 { + static readonly discriminator = 11; + static readonly kind = "None11"; + readonly discriminator = 11; + readonly kind = "None11"; + + toJSON(): None11JSON { + return { + kind: "None11", + }; + } + + toEncodable() { + return { + None11: {}, + }; + } +} + +export interface None12JSON { + kind: "None12"; +} + +export class None12 { + static readonly discriminator = 12; + static readonly kind = "None12"; + readonly discriminator = 12; + readonly kind = "None12"; + + toJSON(): None12JSON { + return { + kind: "None12", + }; + } + + toEncodable() { + return { + None12: {}, + }; + } +} + +export interface None13JSON { + kind: "None13"; +} + +export class None13 { + static readonly discriminator = 13; + static readonly kind = "None13"; + readonly discriminator = 13; + readonly kind = "None13"; + + toJSON(): None13JSON { + return { + kind: "None13", + }; + } + + toEncodable() { + return { + None13: {}, + }; + } +} + +export interface None14JSON { + kind: "None14"; +} + +export class None14 { + static readonly discriminator = 14; + static readonly kind = "None14"; + readonly discriminator = 14; + readonly kind = "None14"; + + toJSON(): None14JSON { + return { + kind: "None14", + }; + } + + toEncodable() { + return { + None14: {}, + }; + } +} + +export interface None15JSON { + kind: "None15"; +} + +export class None15 { + static readonly discriminator = 15; + static readonly kind = "None15"; + readonly discriminator = 15; + readonly kind = "None15"; + + toJSON(): None15JSON { + return { + kind: "None15", + }; + } + + toEncodable() { + return { + None15: {}, + }; + } +} + export interface InvalidPermissionsJSON { kind: "InvalidPermissions"; } export class InvalidPermissions { - static readonly discriminator = 5; + static readonly discriminator = 16; static readonly kind = "InvalidPermissions"; - readonly discriminator = 5; + readonly discriminator = 16; readonly kind = "InvalidPermissions"; toJSON(): InvalidPermissionsJSON { @@ -158,12 +411,45 @@ export function fromDecoded(obj: any): types.FunctionStatusKind { if ("NonExecutable" in obj) { return new NonExecutable(); } + if ("None3" in obj) { + return new None3(); + } if ("Expired" in obj) { return new Expired(); } + if ("None5" in obj) { + return new None5(); + } + if ("None6" in obj) { + return new None6(); + } + if ("None7" in obj) { + return new None7(); + } if ("OutOfFunds" in obj) { return new OutOfFunds(); } + if ("None9" in obj) { + return new None9(); + } + if ("None10" in obj) { + return new None10(); + } + if ("None11" in obj) { + return new None11(); + } + if ("None12" in obj) { + return new None12(); + } + if ("None13" in obj) { + return new None13(); + } + if ("None14" in obj) { + return new None14(); + } + if ("None15" in obj) { + return new None15(); + } if ("InvalidPermissions" in obj) { return new InvalidPermissions(); } @@ -184,12 +470,45 @@ export function fromJSON( case "NonExecutable": { return new NonExecutable(); } + case "None3": { + return new None3(); + } case "Expired": { return new Expired(); } + case "None5": { + return new None5(); + } + case "None6": { + return new None6(); + } + case "None7": { + return new None7(); + } case "OutOfFunds": { return new OutOfFunds(); } + case "None9": { + return new None9(); + } + case "None10": { + return new None10(); + } + case "None11": { + return new None11(); + } + case "None12": { + return new None12(); + } + case "None13": { + return new None13(); + } + case "None14": { + return new None14(); + } + case "None15": { + return new None15(); + } case "InvalidPermissions": { return new InvalidPermissions(); } @@ -201,8 +520,19 @@ export function layout(property?: string) { borsh.struct([], "None"), borsh.struct([], "Active"), borsh.struct([], "NonExecutable"), + borsh.struct([], "None3"), borsh.struct([], "Expired"), + borsh.struct([], "None5"), + borsh.struct([], "None6"), + borsh.struct([], "None7"), borsh.struct([], "OutOfFunds"), + borsh.struct([], "None9"), + borsh.struct([], "None10"), + borsh.struct([], "None11"), + borsh.struct([], "None12"), + borsh.struct([], "None13"), + borsh.struct([], "None14"), + borsh.struct([], "None15"), borsh.struct([], "InvalidPermissions"), ]); if (property !== undefined) { diff --git a/javascript/solana.js/src/generated/attestation-program/types/VerificationStatus.ts b/javascript/solana.js/src/generated/attestation-program/types/VerificationStatus.ts index 9361e55db..50fc62163 100644 --- a/javascript/solana.js/src/generated/attestation-program/types/VerificationStatus.ts +++ b/javascript/solana.js/src/generated/attestation-program/types/VerificationStatus.ts @@ -1,10 +1,6 @@ -import { SwitchboardProgram } from "../../../SwitchboardProgram.js"; - -import type * as types from "./index.js"; // eslint-disable-line @typescript-eslint/no-unused-vars +import type * as types from "./index.js"; import * as borsh from "@coral-xyz/borsh"; -import { PublicKey } from "@solana/web3.js"; // eslint-disable-line @typescript-eslint/no-unused-vars -import { BN } from "@switchboard-xyz/common"; // eslint-disable-line @typescript-eslint/no-unused-vars export interface NoneJSON { kind: "None"; @@ -75,6 +71,29 @@ export class VerificationFailure { } } +export interface None3JSON { + kind: "None3"; +} + +export class None3 { + static readonly discriminator = 3; + static readonly kind = "None3"; + readonly discriminator = 3; + readonly kind = "None3"; + + toJSON(): None3JSON { + return { + kind: "None3", + }; + } + + toEncodable() { + return { + None3: {}, + }; + } +} + export interface VerificationSuccessJSON { kind: "VerificationSuccess"; } @@ -98,6 +117,75 @@ export class VerificationSuccess { } } +export interface None5JSON { + kind: "None5"; +} + +export class None5 { + static readonly discriminator = 5; + static readonly kind = "None5"; + readonly discriminator = 5; + readonly kind = "None5"; + + toJSON(): None5JSON { + return { + kind: "None5", + }; + } + + toEncodable() { + return { + None5: {}, + }; + } +} + +export interface None6JSON { + kind: "None6"; +} + +export class None6 { + static readonly discriminator = 6; + static readonly kind = "None6"; + readonly discriminator = 6; + readonly kind = "None6"; + + toJSON(): None6JSON { + return { + kind: "None6", + }; + } + + toEncodable() { + return { + None6: {}, + }; + } +} + +export interface None7JSON { + kind: "None7"; +} + +export class None7 { + static readonly discriminator = 7; + static readonly kind = "None7"; + readonly discriminator = 7; + readonly kind = "None7"; + + toJSON(): None7JSON { + return { + kind: "None7", + }; + } + + toEncodable() { + return { + None7: {}, + }; + } +} + export interface VerificationOverrideJSON { kind: "VerificationOverride"; } @@ -136,9 +224,21 @@ export function fromDecoded(obj: any): types.VerificationStatusKind { if ("VerificationFailure" in obj) { return new VerificationFailure(); } + if ("None3" in obj) { + return new None3(); + } if ("VerificationSuccess" in obj) { return new VerificationSuccess(); } + if ("None5" in obj) { + return new None5(); + } + if ("None6" in obj) { + return new None6(); + } + if ("None7" in obj) { + return new None7(); + } if ("VerificationOverride" in obj) { return new VerificationOverride(); } @@ -159,9 +259,21 @@ export function fromJSON( case "VerificationFailure": { return new VerificationFailure(); } + case "None3": { + return new None3(); + } case "VerificationSuccess": { return new VerificationSuccess(); } + case "None5": { + return new None5(); + } + case "None6": { + return new None6(); + } + case "None7": { + return new None7(); + } case "VerificationOverride": { return new VerificationOverride(); } @@ -173,7 +285,11 @@ export function layout(property?: string) { borsh.struct([], "None"), borsh.struct([], "VerificationPending"), borsh.struct([], "VerificationFailure"), + borsh.struct([], "None3"), borsh.struct([], "VerificationSuccess"), + borsh.struct([], "None5"), + borsh.struct([], "None6"), + borsh.struct([], "None7"), borsh.struct([], "VerificationOverride"), ]); if (property !== undefined) { diff --git a/javascript/solana.js/src/generated/attestation-program/types/index.ts b/javascript/solana.js/src/generated/attestation-program/types/index.ts index 3b8eda15e..da3260695 100644 --- a/javascript/solana.js/src/generated/attestation-program/types/index.ts +++ b/javascript/solana.js/src/generated/attestation-program/types/index.ts @@ -162,15 +162,37 @@ export type FunctionStatusKind = | FunctionStatus.None | FunctionStatus.Active | FunctionStatus.NonExecutable + | FunctionStatus.None3 | FunctionStatus.Expired + | FunctionStatus.None5 + | FunctionStatus.None6 + | FunctionStatus.None7 | FunctionStatus.OutOfFunds + | FunctionStatus.None9 + | FunctionStatus.None10 + | FunctionStatus.None11 + | FunctionStatus.None12 + | FunctionStatus.None13 + | FunctionStatus.None14 + | FunctionStatus.None15 | FunctionStatus.InvalidPermissions; export type FunctionStatusJSON = | FunctionStatus.NoneJSON | FunctionStatus.ActiveJSON | FunctionStatus.NonExecutableJSON + | FunctionStatus.None3JSON | FunctionStatus.ExpiredJSON + | FunctionStatus.None5JSON + | FunctionStatus.None6JSON + | FunctionStatus.None7JSON | FunctionStatus.OutOfFundsJSON + | FunctionStatus.None9JSON + | FunctionStatus.None10JSON + | FunctionStatus.None11JSON + | FunctionStatus.None12JSON + | FunctionStatus.None13JSON + | FunctionStatus.None14JSON + | FunctionStatus.None15JSON | FunctionStatus.InvalidPermissionsJSON; export { FundingStatus }; @@ -203,13 +225,21 @@ export type VerificationStatusKind = | VerificationStatus.None | VerificationStatus.VerificationPending | VerificationStatus.VerificationFailure + | VerificationStatus.None3 | VerificationStatus.VerificationSuccess + | VerificationStatus.None5 + | VerificationStatus.None6 + | VerificationStatus.None7 | VerificationStatus.VerificationOverride; export type VerificationStatusJSON = | VerificationStatus.NoneJSON | VerificationStatus.VerificationPendingJSON | VerificationStatus.VerificationFailureJSON + | VerificationStatus.None3JSON | VerificationStatus.VerificationSuccessJSON + | VerificationStatus.None5JSON + | VerificationStatus.None6JSON + | VerificationStatus.None7JSON | VerificationStatus.VerificationOverrideJSON; export { SwitchboardAttestationPermission }; diff --git a/javascript/solana.js/src/utils.ts b/javascript/solana.js/src/utils.ts index 320e7a698..52bf23001 100644 --- a/javascript/solana.js/src/utils.ts +++ b/javascript/solana.js/src/utils.ts @@ -244,6 +244,19 @@ export function parseRawBuffer(rawBuffer: RawBuffer, size = 32): Uint8Array { ); } +export function containsMrEnclave( + mrEnclaves: number[][], + targetMrEnclave: number[] | Uint8Array +): boolean { + return mrEnclaves.some((arr) => { + if (arr.length !== targetMrEnclave.length) return false; + for (let i = 0; i < arr.length; i++) { + if (arr[i] !== targetMrEnclave[i]) return false; + } + return true; + }); +} + /** * Validate a cron schedule and return a valid 6 element cron string which includes seconds * @param cronSchedule - the cron string to validate diff --git a/rust/switchboard-solana/Cargo.anchor27.lock b/rust/switchboard-solana/Cargo.anchor27.lock index 63a28f451..5970a381a 100644 --- a/rust/switchboard-solana/Cargo.anchor27.lock +++ b/rust/switchboard-solana/Cargo.anchor27.lock @@ -14,9 +14,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -87,9 +87,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8f9420f797f2d9e935edf629310eb938a0d839f984e25327f3c7eed22300c" +checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" dependencies = [ "memchr", ] @@ -117,8 +117,8 @@ checksum = "2d5e1a413b311b039d29b61d0dbb401c9dbf04f792497ceca87593454bf6d7dd" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "regex", "syn 1.0.109", ] @@ -132,8 +132,8 @@ dependencies = [ "anchor-syn", "anyhow", "bs58 0.4.0", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "rustversion", "syn 1.0.109", ] @@ -145,7 +145,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "788e44f9e8501dabeb6f9229da0f3268fb2ae3208912608ffaa056a72031296f" dependencies = [ "anchor-syn", - "proc-macro2 1.0.66", + "proc-macro2 1.0.67", "syn 1.0.109", ] @@ -156,8 +156,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea0c4d8c7e4a2605ede6fcdced9690288b2f74e24768619a85229d57e597bc97" dependencies = [ "anchor-syn", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -169,8 +169,8 @@ checksum = "7a3b07d5c5d87b5edc72428b447b8e9ee1143b83dd1afc6a6b1d352c6a6164d8" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -182,8 +182,8 @@ checksum = "b22ad0445115dbea5869b1d062da49ae125abed9132fc20c33227f25e42dfa6b" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -212,8 +212,8 @@ checksum = "48daeff6781ba2f02961b0ad211feb9a2de75af345d42c62b1a252fd4dfb0724" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -223,8 +223,8 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4fe2886f92c4f33ec1b2b8b2b43ca1b9070cf4929e63c7eaaa09a9f2c0d5123" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -273,8 +273,8 @@ dependencies = [ "anyhow", "bs58 0.3.1", "heck", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "serde", "serde_json", "sha2 0.9.9", @@ -308,9 +308,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "arrayref" @@ -343,7 +343,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.25", + "time", ] [[package]] @@ -352,8 +352,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", "synstructure", ] @@ -364,8 +364,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -377,9 +377,9 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "async-compression" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b74f44609f0f91493e3082d3734d98497e094777144380ea4db9f9905dd5b6" +checksum = "bb42b2197bf15ccb092b62c74515dbd8b86d0effd934795f6687c93b6e679a2c" dependencies = [ "brotli", "flate2", @@ -400,13 +400,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.72" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.33", ] [[package]] @@ -428,9 +428,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -455,15 +455,15 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64ct" -version = "1.6.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "e6b4d9b1225d28d360ec6a231d65af1fd99a2a095154c8040689617290569c5c" [[package]] name = "bincode" @@ -482,9 +482,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bitmaps" @@ -575,7 +575,7 @@ dependencies = [ "borsh-derive-internal 0.9.3", "borsh-schema-derive-internal 0.9.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.66", + "proc-macro2 1.0.67", "syn 1.0.109", ] @@ -588,7 +588,7 @@ dependencies = [ "borsh-derive-internal 0.10.3", "borsh-schema-derive-internal 0.10.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.66", + "proc-macro2 1.0.67", "syn 1.0.109", ] @@ -598,8 +598,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -609,8 +609,8 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -620,8 +620,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -631,8 +631,8 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -702,29 +702,29 @@ version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.33", ] [[package]] @@ -735,9 +735,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "caps" @@ -751,9 +751,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", @@ -767,18 +767,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.5", ] [[package]] @@ -873,6 +872,12 @@ dependencies = [ "web-sys", ] +[[package]] +name = "const-oid" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b" + [[package]] name = "const-oid" version = "0.7.1" @@ -979,6 +984,17 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83bd3bb4314701c568e340cd8cf78c975aa0ca79e03d3f6d1677d5b0c9c0c03" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -1028,13 +1044,23 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +[[package]] +name = "der" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79b71cca7d95d7681a4b3b9cdf63c8dbc3730d0584c2c74e31416d64a90493f4" +dependencies = [ + "const-oid 0.6.2", + "crypto-bigint", +] + [[package]] name = "der" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" dependencies = [ - "const-oid", + "const-oid 0.7.1", ] [[package]] @@ -1046,16 +1072,16 @@ dependencies = [ "asn1-rs", "displaydoc", "nom 7.1.3", - "num-bigint 0.4.3", + "num-bigint 0.4.4", "num-traits", "rusticata-macros", ] [[package]] name = "deranged" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" [[package]] name = "derivation-path" @@ -1122,9 +1148,9 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.33", ] [[package]] @@ -1205,9 +1231,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -1227,8 +1253,8 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -1239,9 +1265,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" dependencies = [ "once_cell", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.33", ] [[package]] @@ -1274,9 +1300,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", @@ -1313,9 +1339,9 @@ checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "miniz_oxide", @@ -1327,6 +1353,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.2.0" @@ -1396,9 +1437,9 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.33", ] [[package]] @@ -1489,15 +1530,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -1644,9 +1685,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -1687,11 +1728,24 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.6", + "rustls 0.21.7", "tokio", "tokio-rustls 0.24.1", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + [[package]] name = "iana-time-zone" version = "0.1.57" @@ -1850,6 +1904,9 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] [[package]] name = "lexical-core" @@ -1866,9 +1923,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libloading" @@ -1880,6 +1937,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "libm" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" + [[package]] name = "libsecp256k1" version = "0.6.0" @@ -1936,9 +1999,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" [[package]] name = "lock_api" @@ -1952,15 +2015,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "memmap2" @@ -2033,6 +2096,24 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "nix" version = "0.24.3" @@ -2093,15 +2174,32 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", "num-traits", ] +[[package]] +name = "num-bigint-dig" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9bc3e36fd683e004fd59c64a425e0e991616f5a8b617c3b9a933a93c168facc" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand 0.8.5", + "smallvec", + "zeroize", +] + [[package]] name = "num-complex" version = "0.2.4" @@ -2118,8 +2216,8 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -2163,6 +2261,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -2191,8 +2290,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -2204,9 +2303,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -2232,12 +2331,50 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "openssl" +version = "0.10.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +dependencies = [ + "bitflags 2.4.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.33", +] + [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-sys" +version = "0.9.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "os_str_bytes" version = "6.5.1" @@ -2264,7 +2401,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -2294,6 +2431,15 @@ dependencies = [ "base64 0.13.1", ] +[[package]] +name = "pem-rfc7468" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84e93a3b1cc0510b03020f33f21e62acdde3dcaef432edc95bea377fbd4c2cd4" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.0" @@ -2311,9 +2457,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -2321,14 +2467,38 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs1" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "116bee8279d783c0cf370efa1a94632f2108e5ef0bb32df31f051647810a4e2c" +dependencies = [ + "der 0.4.5", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "pkcs8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee3ef9b64d26bad0536099c816c6734379e45bbd5f14798def6809e5cc350447" +dependencies = [ + "der 0.4.5", + "pem-rfc7468", + "pkcs1", + "spki 0.4.1", + "zeroize", +] + [[package]] name = "pkcs8" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" dependencies = [ - "der", - "spki", + "der 0.5.1", + "spki 0.5.4", "zeroize", ] @@ -2386,9 +2556,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -2408,8 +2578,8 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -2434,7 +2604,7 @@ dependencies = [ "fxhash", "quinn-proto", "quinn-udp", - "rustls 0.20.8", + "rustls 0.20.9", "thiserror", "tokio", "tracing", @@ -2451,7 +2621,7 @@ dependencies = [ "fxhash", "rand 0.8.5", "ring", - "rustls 0.20.8", + "rustls 0.20.9", "rustls-native-certs", "rustls-pemfile 0.2.1", "slab", @@ -2486,11 +2656,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.67", ] [[package]] @@ -2609,7 +2779,7 @@ checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" dependencies = [ "pem", "ring", - "time 0.3.25", + "time", "yasna", ] @@ -2644,9 +2814,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.3" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ "aho-corasick", "memchr", @@ -2656,9 +2826,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ "aho-corasick", "memchr", @@ -2667,9 +2837,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "rend" @@ -2682,12 +2852,12 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ "async-compression", - "base64 0.21.2", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", @@ -2697,19 +2867,22 @@ dependencies = [ "http-body", "hyper", "hyper-rustls", + "hyper-tls", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.6", + "rustls 0.21.7", "rustls-pemfile 1.0.3", "serde", "serde_json", "serde_urlencoded", "tokio", + "tokio-native-tls", "tokio-rustls 0.24.1", "tokio-util", "tower-service", @@ -2717,7 +2890,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", + "webpki-roots 0.25.2", "winreg", ] @@ -2759,8 +2932,8 @@ version = "0.7.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", ] @@ -2776,15 +2949,34 @@ dependencies = [ "winapi", ] +[[package]] +name = "rsa" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c2603e2823634ab331437001b411b9ed11660fbc4066f3908c84a9439260d" +dependencies = [ + "byteorder", + "digest 0.9.0", + "lazy_static", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1", + "pkcs8 0.7.6", + "rand 0.8.5", + "subtle", + "zeroize", +] + [[package]] name = "rust_decimal" -version = "1.31.0" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a2ab0025103a60ecaaf3abf24db1db240a4e1c15837090d2c32f625ac98abea" +checksum = "a4c4216490d5a413bc6d10fa4742bd7d4955941d062c0ef873141d6b0e7b30fd" dependencies = [ "arrayvec 0.7.4", "borsh 0.10.3", - "byteorder", "bytes", "num-traits", "rand 0.8.5", @@ -2825,11 +3017,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.7" +version = "0.38.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "172891ebdceb05aa0005f533a6cbfca599ddd7d966f6f5d4d9b2e70478e70399" +checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "errno", "libc", "linux-raw-sys", @@ -2838,9 +3030,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ "log", "ring", @@ -2850,9 +3042,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.6" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", @@ -2887,14 +3079,14 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", ] [[package]] name = "rustls-webpki" -version = "0.101.3" +version = "0.101.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261e9e0888cba427c3316e6322805653c9425240b6fd96cee7cb671ab70ab8d0" +checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" dependencies = [ "ring", "untrusted", @@ -2974,9 +3166,9 @@ checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.183" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -2992,20 +3184,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.183" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.33", ] [[package]] name = "serde_json" -version = "1.0.104" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -3141,9 +3333,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -3166,9 +3358,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", "windows-sys 0.48.0", @@ -3283,7 +3475,7 @@ dependencies = [ "rand_chacha 0.2.2", "rayon", "reqwest", - "rustls 0.20.8", + "rustls 0.20.9", "semver", "serde", "serde_derive", @@ -3386,8 +3578,8 @@ version = "1.14.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57892538250428ad3dc3cbe05f6cd75ad14f4f16734fcb91bc7cd5fbb63d6315" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "rustc_version", "syn 1.0.109", ] @@ -3639,8 +3831,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d41a09b9cecd0a4df63c78a192adee99ebf2d3757c19713a68246e1d9789c7c" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "rustversion", "syn 1.0.109", ] @@ -3661,11 +3853,11 @@ dependencies = [ "nix", "pem", "percentage", - "pkcs8", + "pkcs8 0.8.0", "quinn", "rand 0.7.3", "rcgen", - "rustls 0.20.8", + "rustls 0.20.9", "solana-metrics", "solana-perf", "solana-sdk", @@ -3777,6 +3969,15 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spki" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c01a0c15da1b0b0e1494112e7af814a678fec9bd157881b49beac661e9b6f32" +dependencies = [ + "der 0.4.5", +] + [[package]] name = "spki" version = "0.5.4" @@ -3784,7 +3985,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" dependencies = [ "base64ct", - "der", + "der 0.5.1", ] [[package]] @@ -3877,7 +4078,7 @@ checksum = "ab16ced94dbd8a46c82fd81e3ed9a8727dac2977ea869d217bcc4ea1f122e81f" [[package]] name = "switchboard-common" -version = "0.8.7" +version = "0.8.18" dependencies = [ "envy", "getrandom 0.2.10", @@ -3890,7 +4091,7 @@ dependencies = [ [[package]] name = "switchboard-solana" -version = "0.27.8" +version = "0.27.18" dependencies = [ "anchor-client", "anchor-lang", @@ -3900,7 +4101,12 @@ dependencies = [ "chrono", "cron", "hex", + "rand 0.8.5", + "reqwest", + "rsa", "rust_decimal", + "serde", + "serde_json", "sgx-quote", "solana-address-lookup-table-program", "solana-client", @@ -3928,19 +4134,19 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.28" +version = "2.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "unicode-ident", ] @@ -3950,8 +4156,8 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.67", + "quote 1.0.33", "syn 1.0.109", "unicode-xid 0.2.4", ] @@ -3964,9 +4170,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", "fastrand", @@ -4001,40 +4207,29 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.33", ] [[package]] name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" +checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" dependencies = [ "deranged", "itoa", @@ -4051,9 +4246,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" +checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" dependencies = [ "time-core", ] @@ -4094,9 +4289,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.30.0" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3ce25f50619af8b0aec2eb23deebe84249e19e2ddd393a6e16e3300a6dadfd" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ "backtrace", "bytes", @@ -4106,7 +4301,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.4", "tokio-macros", "windows-sys 0.48.0", ] @@ -4117,9 +4312,19 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.33", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", ] [[package]] @@ -4128,7 +4333,7 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls 0.20.8", + "rustls 0.20.9", "tokio", "webpki", ] @@ -4139,7 +4344,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.6", + "rustls 0.21.7", "tokio", ] @@ -4162,12 +4367,12 @@ checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" dependencies = [ "futures-util", "log", - "rustls 0.20.8", + "rustls 0.20.9", "tokio", "tokio-rustls 0.23.4", "tungstenite", "webpki", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] @@ -4201,9 +4406,9 @@ checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.0.0", "toml_datetime", @@ -4234,9 +4439,9 @@ version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.33", ] [[package]] @@ -4267,13 +4472,13 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.20.8", + "rustls 0.20.9", "sha-1", "thiserror", "url", "utf-8", "webpki", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] @@ -4290,9 +4495,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -4355,9 +4560,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -4376,6 +4581,12 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "vec_map" version = "0.8.2" @@ -4403,12 +4614,6 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -4434,9 +4639,9 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.33", "wasm-bindgen-shared", ] @@ -4458,7 +4663,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ - "quote 1.0.32", + "quote 1.0.33", "wasm-bindgen-macro-support", ] @@ -4468,9 +4673,9 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.33", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4493,9 +4698,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "f0e74f82d49d545ad128049b7e88f6576df2da6b02e9ce565c6f533be576957e" dependencies = [ "ring", "untrusted", @@ -4510,6 +4715,12 @@ dependencies = [ "webpki", ] +[[package]] +name = "webpki-roots" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" + [[package]] name = "winapi" version = "0.3.9" @@ -4547,7 +4758,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -4565,7 +4776,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -4585,17 +4796,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -4606,9 +4817,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -4618,9 +4829,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -4630,9 +4841,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -4642,9 +4853,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -4654,9 +4865,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -4666,9 +4877,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -4678,26 +4889,27 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.4" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acaaa1190073b2b101e15083c38ee8ec891b5e05cbee516521e94ec008f61e64" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -4724,7 +4936,7 @@ dependencies = [ "oid-registry", "rusticata-macros", "thiserror", - "time 0.3.25", + "time", ] [[package]] @@ -4742,7 +4954,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "time 0.3.25", + "time", ] [[package]] @@ -4760,9 +4972,9 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.67", + "quote 1.0.33", + "syn 2.0.33", ] [[package]] diff --git a/rust/switchboard-solana/Cargo.anchor27.toml b/rust/switchboard-solana/Cargo.anchor27.toml index ad9931b2e..5ce75d6d9 100644 --- a/rust/switchboard-solana/Cargo.anchor27.toml +++ b/rust/switchboard-solana/Cargo.anchor27.toml @@ -1,6 +1,6 @@ [package] name = "switchboard-solana" -version = "0.27.8" +version = "0.27.18" edition = "2021" description = "A Rust library to interact with Switchboard accounts." readme = "README.md" @@ -18,6 +18,7 @@ doctest = false default = ["cpi"] no-entrypoint = [] cpi = ["no-entrypoint"] +secrets = ["rand", "rsa", "reqwest", "serde", "serde_json"] [dependencies] anchor-spl = "0.27.0" @@ -28,11 +29,11 @@ bytemuck = "^1" superslice = "1" [target.'cfg(target_os = "solana")'.dependencies] -switchboard-common = { version = "0.8.7", path = "../switchboard-common" } +switchboard-common = { version = "0.8.15", path = "../switchboard-common" } anchor-lang = { version = "0.27.0" } [target.'cfg(not(target_os = "solana"))'.dependencies] -switchboard-common = { version = "0.8.7", path = "../switchboard-common", features = [ +switchboard-common = { version = "0.8.15", path = "../switchboard-common", features = [ "client", "solana", ] } @@ -46,5 +47,12 @@ hex = "0.4.3" tokio = "1" url = "2.4" +# Secrets Dependencies +rsa = { version = "0.5.0", optional = true } +reqwest = { version = "0.11", features = ["json"], optional = true } +rand = { version = "0.8.5", optional = true } +serde = { version = "^1", features = ["derive"], optional = true } +serde_json = { version = "^1", optional = true } + [package.metadata.docs.rs] rustdoc-args = ["--cfg", "doc_cfg"] diff --git a/rust/switchboard-solana/Cargo.lock b/rust/switchboard-solana/Cargo.lock index 8767e7288..4b0e07493 100644 --- a/rust/switchboard-solana/Cargo.lock +++ b/rust/switchboard-solana/Cargo.lock @@ -4439,13 +4439,11 @@ checksum = "ab16ced94dbd8a46c82fd81e3ed9a8727dac2977ea869d217bcc4ea1f122e81f" [[package]] name = "switchboard-common" -version = "0.8.15" +version = "0.8.18" dependencies = [ "envy", "getrandom 0.2.10", "hex", - "rand 0.8.5", - "reqwest", "serde", "serde_json", "sgx-quote", @@ -4454,7 +4452,7 @@ dependencies = [ [[package]] name = "switchboard-solana" -version = "0.28.11" +version = "0.28.18" dependencies = [ "anchor-client", "anchor-lang", diff --git a/rust/switchboard-solana/Cargo.toml b/rust/switchboard-solana/Cargo.toml index f2e074a35..fd9496338 100644 --- a/rust/switchboard-solana/Cargo.toml +++ b/rust/switchboard-solana/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "switchboard-solana" -version = "0.28.12" +version = "0.28.18" edition = "2021" description = "A Rust library to interact with Switchboard accounts." readme = "README.md" @@ -18,7 +18,7 @@ doctest = false default = ["cpi"] no-entrypoint = [] cpi = ["no-entrypoint"] - +secrets = ["rand", "rsa", "reqwest", "serde", "serde_json"] [dependencies] anchor-spl = "0.28.0" @@ -29,11 +29,11 @@ bytemuck = "^1" superslice = "1" [target.'cfg(target_os = "solana")'.dependencies] -switchboard-common = { version = "0.8.14" } +switchboard-common = { version = "0.8.18" } anchor-lang = { version = "0.28.0" } [target.'cfg(not(target_os = "solana"))'.dependencies] -switchboard-common = { version = "0.8.15", features = [ +switchboard-common = { version = "0.8.18", features = [ "client", "solana", ] } @@ -46,11 +46,13 @@ chrono = { version = "0.4.25" } hex = "0.4.3" tokio = "1" url = "2.4" -rsa = { version = "0.5.0" } -serde = { version = "^1", features = ["derive"] } -serde_json = "^1" -reqwest = { version = "0.11", features = ["json"] } -rand = { version = "0.8.5" } + +# Secrets Dependencies +rsa = { version = "0.5.0", optional = true } +reqwest = { version = "0.11", features = ["json"], optional = true } +rand = { version = "0.8.5", optional = true } +serde = { version = "^1", features = ["derive"], optional = true } +serde_json = { version = "^1", optional = true } [package.metadata.docs.rs] rustdoc-args = ["--cfg", "doc_cfg"] diff --git a/rust/switchboard-solana/src/lib.rs b/rust/switchboard-solana/src/lib.rs index 1164a76a1..bd0fe7998 100644 --- a/rust/switchboard-solana/src/lib.rs +++ b/rust/switchboard-solana/src/lib.rs @@ -125,8 +125,12 @@ pub mod prelude; cfg_client! { pub mod client; pub use client::*; - pub mod secrets; - pub use secrets::*; + + // Only enable this feature if client is already enabled + cfg_secrets! { + pub mod secrets; + pub use secrets::*; + } } /// Program id for the Switchboard oracle program diff --git a/rust/switchboard-solana/src/macros.rs b/rust/switchboard-solana/src/macros.rs index 9d1d6ffe2..26c1d37e1 100644 --- a/rust/switchboard-solana/src/macros.rs +++ b/rust/switchboard-solana/src/macros.rs @@ -12,6 +12,17 @@ macro_rules! cfg_client { } } +#[macro_export] +macro_rules! cfg_secrets { + ($($item:item)*) => { + $( + #[cfg(feature = "secrets")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "secrets")))] + $item + )* + } +} + #[macro_export] macro_rules! cfg_program { ($($item:item)*) => {