From 5a30fe6e1a1204e2ae2fc9f2ec67077c07b03bcf Mon Sep 17 00:00:00 2001 From: Uxio Fuentefria <6909403+Uxio0@users.noreply.github.com> Date: Wed, 8 May 2024 10:48:22 +0200 Subject: [PATCH] 4337: Ignore UserOperations for v0.7.0 entrypoint - It changes a lot of logic and it's not fully supported in other networks but Sepolia - We should wait to implement #2011 --- requirements.txt | 2 +- .../services/aa_processor_service.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a3116dd77..208cebd0f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,5 +33,5 @@ psycogreen==1.0.2 psycopg2==2.9.9 redis==5.0.4 requests==2.31.0 -safe-eth-py[django]==6.0.0b27 +safe-eth-py[django]==6.0.0b28 web3==6.17.0 diff --git a/safe_transaction_service/account_abstraction/services/aa_processor_service.py b/safe_transaction_service/account_abstraction/services/aa_processor_service.py index 030e5e818..9a341b1f2 100644 --- a/safe_transaction_service/account_abstraction/services/aa_processor_service.py +++ b/safe_transaction_service/account_abstraction/services/aa_processor_service.py @@ -15,6 +15,7 @@ BundlerClientException, UserOperation, UserOperationReceipt, + UserOperationV07, ) from gnosis.eth.utils import fast_to_checksum_address from gnosis.safe.account_abstraction import SafeOperation @@ -36,6 +37,10 @@ class AaProcessorServiceException(Exception): pass +class UserOperationNotSupportedException(Exception): + pass + + class ExecutionFromSafeModuleNotDetected(AaProcessorServiceException): pass @@ -285,6 +290,10 @@ def index_user_operation( raise BundlerClientException( f"user-operation={user_operation_hash} returned `null`" ) + if isinstance(user_operation, UserOperationV07): + raise UserOperationNotSupportedException( + f"user-operation={user_operation_hash} for EntryPoint v0.7.0 is not supported" + ) try: user_operation_model = UserOperationModel.objects.get( @@ -355,6 +364,12 @@ def process_aa_transaction( for log in aa_logs: try: self.index_user_operation(safe_address, log, ethereum_tx) + except UserOperationNotSupportedException as exc: + logger.error( + "[%s] Error processing user-operation: %s", + safe_address, + exc, + ) except BundlerClientException as exc: logger.error( "[%s] Error retrieving user-operation from bundler API: %s",