Skip to content

Commit e9a85ef

Browse files
committed
fix github private repo access
1 parent 52c3bb3 commit e9a85ef

File tree

5 files changed

+24
-17
lines changed

5 files changed

+24
-17
lines changed

.github/workflows/ci-twmq.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ jobs:
3030
--health-retries 5
3131
3232
steps:
33+
- name: Give GitHub Actions access to @thirdweb-dev/vault
34+
uses: webfactory/ssh-agent@a6f90b1f127823b31d4d4a8d96047790581349bd #@v0.9.1
35+
with:
36+
ssh-private-key: ${{ secrets.VAULT_REPO_DEPLOY_KEY }}
37+
3338
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #checkout@v4
3439

3540
- name: Install CI dependencies

.github/workflows/coverage-twmq.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ jobs:
3030
--health-retries 5
3131
3232
steps:
33+
- name: Give GitHub Actions access to @thirdweb-dev/vault
34+
uses: webfactory/ssh-agent@a6f90b1f127823b31d4d4a8d96047790581349bd #@v0.9.1
35+
with:
36+
ssh-private-key: ${{ secrets.VAULT_REPO_DEPLOY_KEY }}
37+
3338
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #checkout@v4
3439

3540
- name: Install CI dependencies

core/src/error.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use twmq::error::TwmqError;
1111

1212
use crate::chain::Chain;
1313

14-
#[derive(Debug, Error, Serialize, Deserialize)]
14+
#[derive(Debug, Error, Clone, Serialize, Deserialize)]
1515
pub enum RpcErrorKind {
1616
/// Server returned an error response.
1717
#[error("server returned an error response: {0}")]
@@ -56,7 +56,7 @@ pub enum RpcErrorKind {
5656
OtherTransportError(String),
5757
}
5858

59-
#[derive(Debug, Serialize, Deserialize)]
59+
#[derive(Debug, Serialize, Deserialize, Clone)]
6060
pub struct RpcErrorResponse {
6161
/// The error code.
6262
pub code: i64,
@@ -97,7 +97,7 @@ pub struct RpcErrorInfo {
9797
}
9898

9999
/// A serializable contract interaction error type
100-
#[derive(Debug, Error, Serialize, Deserialize)]
100+
#[derive(Debug, Error, Serialize, Deserialize, Clone)]
101101
pub enum ContractInteractionErrorKind {
102102
/// Unknown function referenced.
103103
#[error("unknown function: function {0} does not exist")]
@@ -137,7 +137,7 @@ pub enum ContractInteractionErrorKind {
137137
PendingTransactionError(String),
138138
}
139139

140-
#[derive(Error, Debug, Serialize, Deserialize)]
140+
#[derive(Error, Debug, Serialize, Clone, Deserialize)]
141141
pub enum EngineError {
142142
#[error("RPC error on chain {chain_id} at {rpc_url}: {message}")]
143143
RpcError {

executors/src/external_bundler/confirm.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use alloy::primitives::{Address, Bytes, U256};
22
use engine_core::{
33
chain::{Chain, ChainService, RpcCredentials},
4-
error::AlloyRpcErrorToEngineError,
4+
error::{AlloyRpcErrorToEngineError, EngineError},
55
execution_options::WebhookOptions,
66
rpc_clients::UserOperationReceipt,
77
};
@@ -62,8 +62,7 @@ pub enum UserOpConfirmationError {
6262
ReceiptQueryFailed {
6363
user_op_hash: Bytes,
6464
message: String,
65-
#[serde(skip_serializing_if = "Option::is_none")]
66-
inner_error: Option<serde_json::Value>,
65+
inner_error: Option<EngineError>,
6766
},
6867

6968
#[error("Internal error: {message}")]
@@ -155,7 +154,7 @@ where
155154
.map_err(|e| UserOpConfirmationError::ReceiptQueryFailed {
156155
user_op_hash: job_data.user_op_hash.clone(),
157156
message: e.to_string(),
158-
inner_error: serde_json::to_value(&e.to_engine_bundler_error(&chain)).ok(),
157+
inner_error: Some(e.to_engine_bundler_error(&chain)),
159158
})
160159
.map_err_nack(Some(self.confirmation_retry_delay), RequeuePosition::Last)?;
161160

executors/src/external_bundler/send.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ pub enum ExternalBundlerSendError {
8585
factory_address: Address,
8686
account_salt: String,
8787
message: String,
88-
#[serde(skip_serializing_if = "Option::is_none")]
89-
inner_error: Option<serde_json::Value>,
88+
inner_error: Option<EngineError>,
9089
},
9190

9291
#[error("Deployment lock for account {account_address} could not be acquired: {message}")]
@@ -102,8 +101,7 @@ pub enum ExternalBundlerSendError {
102101
had_deployment_lock: bool,
103102
stage: String,
104103
message: String,
105-
#[serde(skip_serializing_if = "Option::is_none")]
106-
inner_error: Option<serde_json::Value>,
104+
inner_error: Option<EngineError>,
107105
},
108106

109107
#[error("Failed to send UserOperation to bundler: {message}")]
@@ -113,8 +111,7 @@ pub enum ExternalBundlerSendError {
113111
had_deployment_lock: bool,
114112
user_op: UserOpVersion,
115113
message: String,
116-
#[serde(skip_serializing_if = "Option::is_none")]
117-
inner_error: Option<serde_json::Value>,
114+
inner_error: Option<EngineError>,
118115
},
119116

120117
#[error("Invalid RPC Credentials: {message}")]
@@ -288,7 +285,7 @@ where
288285
.factory_address,
289286
account_salt: job_data.execution_options.account_salt.clone(),
290287
message: e.to_string(),
291-
inner_error: serde_json::to_value(&e).ok(),
288+
inner_error: Some(e),
292289
})
293290
.map_err_fail()?,
294291
};
@@ -561,7 +558,7 @@ fn map_build_error(
561558
nonce_used: nonce,
562559
stage,
563560
message: engine_error.to_string(),
564-
inner_error: serde_json::to_value(&engine_error).ok(),
561+
inner_error: Some(engine_error.clone()),
565562
had_deployment_lock: had_lock,
566563
}
567564
}
@@ -581,7 +578,7 @@ fn map_bundler_error(
581578
nonce_used: nonce,
582579
user_op: signed_user_op.clone(),
583580
message: engine_error.to_string(),
584-
inner_error: serde_json::to_value(&engine_error).ok(),
581+
inner_error: Some(engine_error),
585582
had_deployment_lock: had_lock,
586583
}
587584
}
@@ -597,6 +594,7 @@ fn is_build_error_retryable(e: &EngineError) -> bool {
597594
}
598595
EngineError::PaymasterError { kind, .. } | EngineError::BundlerError { kind, .. } => {
599596
!is_http_error_code(kind, 400)
597+
&& !is_http_error_code(kind, 401)
600598
&& !matches!(
601599
kind,
602600
engine_core::error::RpcErrorKind::ErrorResp(r)

0 commit comments

Comments
 (0)