Skip to content

Commit f1d53d8

Browse files
committed
get userop gas fee values from thirdweb pm
1 parent 230d4a0 commit f1d53d8

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

aa-core/src/userop/builder.rs

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,20 @@ impl<'a, C: Chain> UserOpBuilderV0_6<'a, C> {
116116
}
117117

118118
async fn build(mut self) -> Result<VersionedUserOp, EngineError> {
119+
// let prices = self
120+
// .chain
121+
// .provider()
122+
// .estimate_eip1559_fees()
123+
// .await
124+
// .map_err(|err| err.to_engine_error(self.chain))?;
125+
126+
// TODO: modularize this so only used with thirdweb paymaster
119127
let prices = self
120128
.chain
121-
.provider()
122-
.estimate_eip1559_fees()
129+
.paymaster_client()
130+
.get_user_op_gas_fees()
123131
.await
124-
.map_err(|err| err.to_engine_error(self.chain))?;
132+
.map_err(|e| e.to_engine_error(self.chain))?;
125133

126134
tracing::debug!("Gas prices determined");
127135

@@ -222,12 +230,20 @@ impl<'a, C: Chain> UserOpBuilderV0_7<'a, C> {
222230

223231
async fn build(mut self) -> Result<VersionedUserOp, EngineError> {
224232
// Get gas prices, same as v0.6
233+
// let prices = self
234+
// .chain
235+
// .provider()
236+
// .estimate_eip1559_fees()
237+
// .await
238+
// .map_err(|err| err.to_engine_error(self.chain))?;
239+
240+
// TODO: modularize this so only used with thirdweb paymaster
225241
let prices = self
226242
.chain
227-
.provider()
228-
.estimate_eip1559_fees()
243+
.paymaster_client()
244+
.get_user_op_gas_fees()
229245
.await
230-
.map_err(|err| err.to_engine_error(self.chain))?;
246+
.map_err(|e| e.to_engine_error(self.chain))?;
231247

232248
tracing::info!("Gas prices determined");
233249

executors/src/external_bundler/send.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,11 @@ fn is_build_error_retryable(e: &EngineError) -> bool {
692692

693693
/// Check if an RPC error represents a client error (4xx) that shouldn't be retried
694694
fn is_client_error(kind: &RpcErrorKind) -> bool {
695-
matches!(kind,
696-
RpcErrorKind::TransportHttpError { status, .. }
697-
if *status >= 400 && *status < 500
698-
)
695+
match kind {
696+
RpcErrorKind::TransportHttpError { status, .. } if *status >= 400 && *status < 500 => true,
697+
RpcErrorKind::UnsupportedFeature { .. } => true,
698+
_ => false,
699+
}
699700
}
700701

701702
/// Determine if an RPC error from paymaster/bundler should be retried

0 commit comments

Comments
 (0)