diff --git a/rust/main/chains/hyperlane-sealevel/src/mailbox.rs b/rust/main/chains/hyperlane-sealevel/src/mailbox.rs index 82c77390a0..eebf2aafa8 100644 --- a/rust/main/chains/hyperlane-sealevel/src/mailbox.rs +++ b/rust/main/chains/hyperlane-sealevel/src/mailbox.rs @@ -53,28 +53,6 @@ use crate::{ConnectionConf, SealevelProvider, SealevelRpcClient}; const SYSTEM_PROGRAM: &str = "11111111111111111111111111111111"; const SPL_NOOP: &str = "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV"; -// The max amount of compute units for a transaction. -// TODO: consider a more sane value and/or use IGP gas payments instead. -const PROCESS_COMPUTE_UNITS: u32 = 1_400_000; - -/// 0.0005 SOL, in lamports. -/// A typical tx fee without a prioritization fee is 0.000005 SOL, or -/// 5000 lamports. (Example: https://explorer.solana.com/tx/fNd3xVeBzFHeuzr8dXQxLGiHMzTeYpykSV25xWzNRaHtzzjvY9A3MzXh1ZsK2JncRHkwtuWrGEwGXVhFaUCYhtx) -/// See average priority fees here https://solanacompass.com/statistics/fees -/// to inform what to spend here. -const PROCESS_DESIRED_PRIORITIZATION_FEE_LAMPORTS_PER_TX: u64 = 500000; - -/// In micro-lamports. Multiply this by the compute units to figure out -/// the additional cost of processing a message, in addition to the mandatory -/// "base" cost of signature verification. -/// Unused at the moment, but kept for future reference. -#[allow(dead_code)] -const PROCESS_COMPUTE_UNIT_PRICE_MICRO_LAMPORTS: u64 = - // Convert to micro-lamports - (PROCESS_DESIRED_PRIORITIZATION_FEE_LAMPORTS_PER_TX * 1_000_000) - // Divide by the max compute units - / PROCESS_COMPUTE_UNITS as u64; - // Earlier versions of collateral warp routes were deployed off a version where the mint // was requested as a writeable account for handle instruction. This is not necessary, // and generally requires a higher priority fee to be paid. diff --git a/rust/main/chains/hyperlane-sealevel/src/rpc/client.rs b/rust/main/chains/hyperlane-sealevel/src/rpc/client.rs index 63ad2e7368..0e6612ecd1 100644 --- a/rust/main/chains/hyperlane-sealevel/src/rpc/client.rs +++ b/rust/main/chains/hyperlane-sealevel/src/rpc/client.rs @@ -233,8 +233,10 @@ impl SealevelRpcClient { .map_err(ChainCommunicationError::from_other) } - // Standalone logic stolen from Solana's non-blocking client, - // decoupled from the sending of a transaction. + /// Polls the RPC until the transaction is confirmed or the blockhash + /// expires. + /// Standalone logic stolen from Solana's non-blocking client, + /// decoupled from the sending of a transaction. pub async fn wait_for_transaction_confirmation( &self, transaction: &impl SerializableTransaction, @@ -440,7 +442,7 @@ impl SealevelRpcClient { } /// Creates a transaction for a given instruction, compute unit limit, and compute unit price. - /// If `blockhash` is `None`, the latest blockhash is fetched from the RPC. + /// If `sign` is true, the transaction will be signed. pub async fn create_transaction_for_instruction( &self, compute_unit_limit: u32, @@ -463,8 +465,11 @@ impl SealevelRpcClient { ]; let tx = if sign { + // Getting the finalized blockhash eliminates the chance the blockhash + // gets reorged out, causing the tx to be invalid. The tradeoff is this + // will cause the tx to expire in about 47 seconds (instead of the typical 60). let recent_blockhash = self - .get_latest_blockhash_with_commitment(CommitmentConfig::processed()) + .get_latest_blockhash_with_commitment(CommitmentConfig::finalized()) .await .map_err(ChainCommunicationError::from_other)?; diff --git a/rust/main/helm/hyperlane-agent/templates/external-secret.yaml b/rust/main/helm/hyperlane-agent/templates/external-secret.yaml index 7d169c40f8..f3a6980d21 100644 --- a/rust/main/helm/hyperlane-agent/templates/external-secret.yaml +++ b/rust/main/helm/hyperlane-agent/templates/external-secret.yaml @@ -30,9 +30,14 @@ spec: {{- if eq .protocol "cosmos" }} HYP_CHAINS_{{ .name | upper }}_CUSTOMGRPCURLS: {{ printf "'{{ .%s_grpcs | mustFromJson | join \",\" }}'" .name }} {{- end }} - {{- if and (eq .protocol "sealevel") (eq ((.priorityFeeOracle).type) "helius") }} + {{- if eq .protocol "sealevel" }} + {{- if eq ((.priorityFeeOracle).type) "helius" }} HYP_CHAINS_{{ .name | upper }}_PRIORITYFEEORACLE_URL: {{ printf "'{{ .%s_helius }}'" .name }} {{- end }} + {{- if eq ((.transactionSubmitter).url) "helius" }} + HYP_CHAINS_{{ .name | upper }}_TRANSACTIONSUBMITTER_URL: {{ printf "'{{ .%s_helius }}'" .name }} + {{- end }} + {{- end }} {{- end }} data: {{- /* @@ -48,7 +53,7 @@ spec: remoteRef: key: {{ printf "%s-grpc-endpoints-%s" $.Values.hyperlane.runEnv .name }} {{- end }} - {{- if and (eq .protocol "sealevel") (eq ((.priorityFeeOracle).type) "helius") }} + {{- if and (eq .protocol "sealevel") (or (eq ((.priorityFeeOracle).type) "helius") (eq ((.transactionSubmitter).url) "helius")) }} - secretKey: {{ printf "%s_helius" .name }} remoteRef: key: {{ printf "%s-rpc-endpoint-helius-%s" $.Values.hyperlane.runEnv .name }} diff --git a/rust/main/helm/hyperlane-agent/templates/relayer-statefulset.yaml b/rust/main/helm/hyperlane-agent/templates/relayer-statefulset.yaml index da69543d8e..47be9ad2e9 100644 --- a/rust/main/helm/hyperlane-agent/templates/relayer-statefulset.yaml +++ b/rust/main/helm/hyperlane-agent/templates/relayer-statefulset.yaml @@ -17,7 +17,9 @@ spec: metadata: annotations: checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + checksum/external-secret: {{ include (print $.Template.BasePath "/external-secret.yaml") . | sha256sum }} checksum/relayer-configmap: {{ include (print $.Template.BasePath "/relayer-configmap.yaml") . | sha256sum }} + checksum/relayer-external-secret: {{ include (print $.Template.BasePath "/relayer-external-secret.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/rust/main/helm/hyperlane-agent/templates/scraper-statefulset.yaml b/rust/main/helm/hyperlane-agent/templates/scraper-statefulset.yaml index 06326e260c..1b419e1123 100644 --- a/rust/main/helm/hyperlane-agent/templates/scraper-statefulset.yaml +++ b/rust/main/helm/hyperlane-agent/templates/scraper-statefulset.yaml @@ -17,6 +17,8 @@ spec: metadata: annotations: checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + checksum/external-secret: {{ include (print $.Template.BasePath "/external-secret.yaml") . | sha256sum }} + checksum/scraper-external-secret: {{ include (print $.Template.BasePath "/scraper-external-secret.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/rust/main/helm/hyperlane-agent/templates/validator-statefulset.yaml b/rust/main/helm/hyperlane-agent/templates/validator-statefulset.yaml index 1b0a87dd41..b5929bfd99 100644 --- a/rust/main/helm/hyperlane-agent/templates/validator-statefulset.yaml +++ b/rust/main/helm/hyperlane-agent/templates/validator-statefulset.yaml @@ -17,7 +17,9 @@ spec: metadata: annotations: checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + checksum/external-secret: {{ include (print $.Template.BasePath "/external-secret.yaml") . | sha256sum }} checksum/validator-configmap: {{ include (print $.Template.BasePath "/validator-configmap.yaml") . | sha256sum }} + checksum/scraper-external-secret: {{ include (print $.Template.BasePath "/scraper-external-secret.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index 59d8386c49..cf3e227d0f 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -12,6 +12,7 @@ import { import { AgentChainConfig, + HELIUS_SECRET_URL_MARKER, RootAgentConfig, getAgentChainNamesFromConfig, } from '../../../src/config/agent/agent.js'; @@ -388,7 +389,8 @@ const sealevelTransactionSubmitterConfigGetter = ( // Special case for Solana mainnet if (chain === 'solanamainnet') { return { - type: AgentSealevelTransactionSubmitterType.Jito, + type: AgentSealevelTransactionSubmitterType.Rpc, + url: HELIUS_SECRET_URL_MARKER, }; } @@ -548,7 +550,7 @@ const releaseCandidate: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '0b61be6-20241211-051755', + tag: 'b98678c-20241213-043725', }, // We're temporarily (ab)using the RC relayer as a way to increase // message throughput. diff --git a/typescript/infra/src/config/agent/agent.ts b/typescript/infra/src/config/agent/agent.ts index 57296b8efb..7d2dbe54b6 100644 --- a/typescript/infra/src/config/agent/agent.ts +++ b/typescript/infra/src/config/agent/agent.ts @@ -99,6 +99,9 @@ export interface SealevelAgentConfig { ) => AgentSealevelTransactionSubmitter; } +// An ugly way to mark a URL as a the secret Helius URL when Helm templating +export const HELIUS_SECRET_URL_MARKER = 'helius'; + // incomplete common agent configuration for a role interface AgentRoleConfig { // K8s-specific