Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index 4337 UserOperations #1884

Merged
merged 49 commits into from
Apr 1, 2024
Merged

Index 4337 UserOperations #1884

merged 49 commits into from
Apr 1, 2024

Conversation

.pre-commit-config.yaml Outdated Show resolved Hide resolved
@Uxio0 Uxio0 force-pushed the index-user-operations branch 3 times, most recently from dc48bcc to a10d49f Compare March 7, 2024 13:22
@Uxio0 Uxio0 force-pushed the index-user-operations branch 2 times, most recently from 5681f84 to 031a28f Compare March 20, 2024 16:28
@Uxio0 Uxio0 force-pushed the index-user-operations branch from 868b15a to 97497f1 Compare March 22, 2024 10:47
@Uxio0 Uxio0 self-assigned this Mar 22, 2024
@Uxio0 Uxio0 marked this pull request as ready for review March 22, 2024 12:07
@Uxio0 Uxio0 requested a review from a team as a code owner March 22, 2024 12:07
Copy link
Member

@moisses89 moisses89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work :) 🚀

safe_transaction_service/utils/ethereum.py Show resolved Hide resolved
requirements.txt Outdated
@@ -33,5 +33,5 @@ psycogreen==1.0.2
psycopg2==2.9.9
redis==5.0.3
requests==2.31.0
safe-eth-py[django]==6.0.0b22
safe-eth-py[django] @ git+https://github.com/safe-global/safe-eth-py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are waiting new safe-eth-py version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will update it before merging

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exceptions is empty.

safe_transaction_service/account_abstraction/models.py Outdated Show resolved Hide resolved
log
for log in logs
if (
len(log["topics"]) == 4
Copy link
Member

@moisses89 moisses89 Mar 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you create a CONSTANT to add more information about what means this 4?

number_detected_user_operations = len(aa_logs)
if not self.bundler_client:
logger.debug(
"Detected 4337 User Operation but bundler client was not configured"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that 4337 transaction won't be indexed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right



class TestModels(TestCase):
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not including too much tests, I would agree if you create an issue to do it later in other PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, included more tests



# FIXME Refactor datetime_to_str
def datetime_to_str(value: datetime.datetime) -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe refactor in utils?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"""
Create a new signed message for a Safe. Message can be:
- A ``string``, so ``EIP191`` will be used to get the hash.
- An ``EIP712`` ``object``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a copy paste documentation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is 😂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@Uxio0 Uxio0 force-pushed the index-user-operations branch 2 times, most recently from 13e4bbd to 97a9b27 Compare March 25, 2024 13:35
Copy link
Contributor

@falvaradorodriguez falvaradorodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! 👌

.github/workflows/python.yml Show resolved Hide resolved
@@ -400,6 +401,9 @@
"safe_transaction_service.history.services.balance_service": {
"level": "DEBUG" if DEBUG else "WARNING",
},
"safe_transaction_service.history.indexers.tx_processor": {
"level": "DEBUG",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always debug?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, I was using it to debug

Copy link
Member Author

@Uxio0 Uxio0 Mar 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@Uxio0 Uxio0 force-pushed the index-user-operations branch from 5066b98 to 7cffc0b Compare March 26, 2024 11:07
@Uxio0 Uxio0 merged commit c37837c into main Apr 1, 2024
6 checks passed
@Uxio0 Uxio0 deleted the index-user-operations branch April 1, 2024 14:17
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants