Skip to content

Commit

Permalink
Merge branch 'protofire-rootstock' into rootstock
Browse files Browse the repository at this point in the history
  • Loading branch information
gofman8 committed Dec 9, 2024
2 parents b3b3583 + 5dd44b7 commit 59e40bd
Show file tree
Hide file tree
Showing 183 changed files with 1,766 additions and 1,664 deletions.
2 changes: 1 addition & 1 deletion .env.custom
Original file line number Diff line number Diff line change
@@ -1 +1 @@
APPLICATION_VERSION=5.0.0
APPLICATION_VERSION=5.9.2
3 changes: 3 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,3 +587,6 @@
TX_SERVICE_ALL_TXS_ENDPOINT_LIMIT_TRANSFERS = env.int(
"TX_SERVICE_ALL_TXS_ENDPOINT_LIMIT_TRANSFERS", default=1_000
) # Don't return more than 1_000 transfers

# Compression level – an integer from 0 to 9. 0 means not compression
CACHE_ALL_TXS_COMPRESSION_LEVEL = env.int("CACHE_ALL_TXS_COMPRESSION_LEVEL", default=0)
3 changes: 3 additions & 0 deletions config/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@
}
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips
INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"]

# Enable to get the host from header
USE_X_FORWARDED_HOST = True
3 changes: 1 addition & 2 deletions docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ http {
# redirects, we set the Host: header above already.
proxy_redirect off;
proxy_pass http://app_server/;

proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
add_header Front-End-Https on;
}
Expand Down
2 changes: 1 addition & 1 deletion docker/web/celery/worker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if [ ${RUN_MIGRATIONS:-0} = 1 ]; then
python manage.py setup_service

echo "==> $(date +%H:%M:%S) ==> Setting contracts... "
python manage.py update_safe_contracts_logo
python manage.py setup_safe_contracts
fi

echo "==> $(date +%H:%M:%S) ==> Check RPC connected matches previously used RPC... "
Expand Down
10 changes: 5 additions & 5 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-r requirements.txt
coverage==7.4.4
django-stubs==5.0.0
django-test-migrations==1.3.0
coverage==7.6.1
django-stubs==5.0.4
django-test-migrations==1.4.0
factory-boy==3.3.0
faker==24.11.0
mypy==1.11.0
mypy==1.11.2
pytest==8.2.0
pytest-celery==1.0.0
pytest-celery==1.1.3
pytest-django==4.8.0
pytest-env==1.1.3
pytest-rerunfailures==14.0
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ asgiref==3.7.2
boto3==1.34.144
cachetools==5.4.0
celery==5.4.0
django==5.0.7
django==5.0.8
django-cache-memoize==0.2.0
django-celery-beat==2.6.0
django-cors-headers==4.4.0
Expand All @@ -13,7 +13,7 @@ django-environ==0.11.2
django-extensions==3.2.3
django-filter==24.2
django-imagekit==5.0.0
django-model-utils==4.5.1
django-model-utils==5.0.0
django-redis==5.4.0
django-s3-storage==0.15.0
django-timezone-field==7.0
Expand All @@ -31,7 +31,7 @@ pika==1.3.2
pillow==10.4.0
psycogreen==1.0.2
psycopg2==2.9.9
redis==5.0.7
redis==5.0.8
requests==2.32.3
safe-eth-py[django]==6.0.0b35
web3==6.20.0
safe-eth-py[django]==6.0.0b37
web3==6.20.2
2 changes: 1 addition & 1 deletion safe_transaction_service/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "5.6.0"
__version__ = "5.9.2"
__version_info__ = tuple(
int(num) if num.isdigit() else num
for num in __version__.replace("-", ".", 1).split(".")
Expand Down
3 changes: 1 addition & 2 deletions safe_transaction_service/account_abstraction/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

from eth_typing import ChecksumAddress
from hexbytes import HexBytes

from gnosis.eth.django.admin import AdvancedAdminSearchMixin
from safe_eth.eth.django.admin import AdvancedAdminSearchMixin

from .models import SafeOperation, UserOperation, UserOperationReceipt

Expand Down
9 changes: 4 additions & 5 deletions safe_transaction_service/account_abstraction/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
from typing import List

from eth_typing import ChecksumAddress

from gnosis.eth import EthereumClient
from gnosis.eth.contracts import get_safe_V1_4_1_contract
from gnosis.eth.utils import fast_to_checksum_address
from gnosis.safe.proxy_factory import ProxyFactoryV141
from safe_eth.eth import EthereumClient
from safe_eth.eth.contracts import get_safe_V1_4_1_contract
from safe_eth.eth.utils import fast_to_checksum_address
from safe_eth.safe.proxy_factory import ProxyFactoryV141


@dataclasses.dataclass(eq=True, frozen=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from django.core.management.base import BaseCommand

from eth_typing import ChecksumAddress

from gnosis.eth.utils import fast_to_checksum_address
from safe_eth.eth.utils import fast_to_checksum_address

from safe_transaction_service.history.models import EthereumTx

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from django.db import migrations, models

import model_utils.fields

import gnosis.eth.django.models
import safe_eth.eth.django.models


class Migration(migrations.Migration):
Expand Down Expand Up @@ -39,15 +38,15 @@ class Migration(migrations.Migration):
),
(
"hash",
gnosis.eth.django.models.Keccak256Field(
safe_eth.eth.django.models.Keccak256Field(
primary_key=True, serialize=False
),
),
("valid_after", models.DateTimeField(null=True)),
("valid_until", models.DateTimeField(null=True)),
(
"module_address",
gnosis.eth.django.models.EthereumAddressV2Field(db_index=True),
safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True),
),
],
options={
Expand Down Expand Up @@ -82,10 +81,10 @@ class Migration(migrations.Migration):
verbose_name="modified",
),
),
("owner", gnosis.eth.django.models.EthereumAddressV2Field()),
("owner", safe_eth.eth.django.models.EthereumAddressV2Field()),
(
"signature",
gnosis.eth.django.models.HexV2Field(
safe_eth.eth.django.models.HexV2Field(
default=None, max_length=5000, null=True
),
),
Expand Down Expand Up @@ -119,25 +118,25 @@ class Migration(migrations.Migration):
fields=[
(
"hash",
gnosis.eth.django.models.Keccak256Field(
safe_eth.eth.django.models.Keccak256Field(
primary_key=True, serialize=False
),
),
(
"sender",
gnosis.eth.django.models.EthereumAddressV2Field(db_index=True),
safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True),
),
("nonce", gnosis.eth.django.models.Uint256Field()),
("nonce", safe_eth.eth.django.models.Uint256Field()),
("init_code", models.BinaryField(blank=True, editable=True, null=True)),
("call_data", models.BinaryField(blank=True, editable=True, null=True)),
("call_data_gas_limit", gnosis.eth.django.models.Uint256Field()),
("verification_gas_limit", gnosis.eth.django.models.Uint256Field()),
("pre_verification_gas", gnosis.eth.django.models.Uint256Field()),
("max_fee_per_gas", gnosis.eth.django.models.Uint256Field()),
("max_priority_fee_per_gas", gnosis.eth.django.models.Uint256Field()),
("call_data_gas_limit", safe_eth.eth.django.models.Uint256Field()),
("verification_gas_limit", safe_eth.eth.django.models.Uint256Field()),
("pre_verification_gas", safe_eth.eth.django.models.Uint256Field()),
("max_fee_per_gas", safe_eth.eth.django.models.Uint256Field()),
("max_priority_fee_per_gas", safe_eth.eth.django.models.Uint256Field()),
(
"paymaster",
gnosis.eth.django.models.EthereumAddressV2Field(
safe_eth.eth.django.models.EthereumAddressV2Field(
blank=True, db_index=True, null=True
),
),
Expand All @@ -148,7 +147,7 @@ class Migration(migrations.Migration):
("signature", models.BinaryField(blank=True, editable=True, null=True)),
(
"entry_point",
gnosis.eth.django.models.EthereumAddressV2Field(db_index=True),
safe_eth.eth.django.models.EthereumAddressV2Field(db_index=True),
),
(
"ethereum_tx",
Expand Down Expand Up @@ -182,11 +181,11 @@ class Migration(migrations.Migration):
verbose_name="ID",
),
),
("actual_gas_cost", gnosis.eth.django.models.Uint256Field()),
("actual_gas_used", gnosis.eth.django.models.Uint256Field()),
("actual_gas_cost", safe_eth.eth.django.models.Uint256Field()),
("actual_gas_used", safe_eth.eth.django.models.Uint256Field()),
("success", models.BooleanField()),
("reason", models.CharField(max_length=256)),
("deposited", gnosis.eth.django.models.Uint256Field()),
("deposited", safe_eth.eth.django.models.Uint256Field()),
(
"user_operation",
models.OneToOneField(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.db import migrations

import gnosis.eth.django.models
import safe_eth.eth.django.models


class Migration(migrations.Migration):
Expand All @@ -18,28 +18,28 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="safeoperation",
name="module_address",
field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True),
field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True),
),
migrations.AlterField(
model_name="safeoperationconfirmation",
name="owner",
field=gnosis.eth.django.models.EthereumAddressBinaryField(),
field=safe_eth.eth.django.models.EthereumAddressBinaryField(),
),
migrations.AlterField(
model_name="useroperation",
name="entry_point",
field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True),
field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True),
),
migrations.AlterField(
model_name="useroperation",
name="paymaster",
field=gnosis.eth.django.models.EthereumAddressBinaryField(
field=safe_eth.eth.django.models.EthereumAddressBinaryField(
blank=True, db_index=True, null=True
),
),
migrations.AlterField(
model_name="useroperation",
name="sender",
field=gnosis.eth.django.models.EthereumAddressBinaryField(db_index=True),
field=safe_eth.eth.django.models.EthereumAddressBinaryField(db_index=True),
),
]
11 changes: 5 additions & 6 deletions safe_transaction_service/account_abstraction/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@
from eth_abi.packed import encode_packed
from hexbytes import HexBytes
from model_utils.models import TimeStampedModel

from gnosis.eth.account_abstraction import UserOperation as UserOperationClass
from gnosis.eth.account_abstraction import UserOperationMetadata
from gnosis.eth.django.models import (
from safe_eth.eth.account_abstraction import UserOperation as UserOperationClass
from safe_eth.eth.account_abstraction import UserOperationMetadata
from safe_eth.eth.django.models import (
EthereumAddressBinaryField,
HexV2Field,
Keccak256Field,
Uint256Field,
)
from gnosis.safe.account_abstraction import SafeOperation as SafeOperationClass
from gnosis.safe.safe_signature import SafeSignatureType
from safe_eth.safe.account_abstraction import SafeOperation as SafeOperationClass
from safe_eth.safe.safe_signature import SafeSignatureType

from safe_transaction_service.history import models as history_models
from safe_transaction_service.utils.constants import SIGNATURE_LENGTH
Expand Down
13 changes: 6 additions & 7 deletions safe_transaction_service/account_abstraction/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
from django.db import transaction
from django.utils import timezone

import safe_eth.eth.django.serializers as eth_serializers
from eth_typing import ChecksumAddress, HexStr
from hexbytes import HexBytes
from rest_framework import serializers
from rest_framework.exceptions import ValidationError

import gnosis.eth.django.serializers as eth_serializers
from gnosis.eth import get_auto_ethereum_client
from gnosis.eth.account_abstraction import UserOperation as UserOperationClass
from gnosis.eth.utils import fast_keccak, fast_to_checksum_address
from gnosis.safe.account_abstraction import SafeOperation as SafeOperationClass
from gnosis.safe.safe_signature import SafeSignature, SafeSignatureType
from safe_eth.eth import get_auto_ethereum_client
from safe_eth.eth.account_abstraction import UserOperation as UserOperationClass
from safe_eth.eth.utils import fast_keccak, fast_to_checksum_address
from safe_eth.safe.account_abstraction import SafeOperation as SafeOperationClass
from safe_eth.safe.safe_signature import SafeSignature, SafeSignatureType

from safe_transaction_service.utils.constants import SIGNATURE_LENGTH
from safe_transaction_service.utils.ethereum import get_chain_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@

from eth_typing import ChecksumAddress, HexStr
from hexbytes import HexBytes
from web3.types import LogReceipt

from gnosis.eth import EthereumClient, get_auto_ethereum_client
from gnosis.eth.account_abstraction import (
from safe_eth.eth import EthereumClient, get_auto_ethereum_client
from safe_eth.eth.account_abstraction import (
BundlerClient,
BundlerClientException,
UserOperation,
UserOperationReceipt,
UserOperationV07,
)
from gnosis.eth.utils import fast_to_checksum_address
from gnosis.safe.account_abstraction import SafeOperation
from gnosis.safe.safe_signature import SafeSignature
from safe_eth.eth.utils import fast_to_checksum_address
from safe_eth.safe.account_abstraction import SafeOperation
from safe_eth.safe.safe_signature import SafeSignature
from web3.types import LogReceipt

from safe_transaction_service.history import models as history_models

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
from eth_abi.packed import encode_packed
from eth_account import Account
from factory.django import DjangoModelFactory

from gnosis.eth.constants import NULL_ADDRESS
from gnosis.eth.utils import fast_keccak_text
from gnosis.safe.safe_signature import SafeSignatureType
from safe_eth.eth.constants import NULL_ADDRESS
from safe_eth.eth.utils import fast_keccak_text
from safe_eth.safe.safe_signature import SafeSignatureType

from safe_transaction_service.history.tests import factories as history_factories

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
from django.test import TestCase

from eth_account import Account

from gnosis.eth import EthereumClient
from gnosis.eth.account_abstraction import BundlerClient
from gnosis.eth.account_abstraction import UserOperation as UserOperationClass
from gnosis.eth.account_abstraction import (
from safe_eth.eth import EthereumClient
from safe_eth.eth.account_abstraction import BundlerClient
from safe_eth.eth.account_abstraction import UserOperation as UserOperationClass
from safe_eth.eth.account_abstraction import (
UserOperationReceipt as UserOperationReceiptClass,
)
from gnosis.eth.tests.mocks.mock_bundler import (
from safe_eth.eth.tests.mocks.mock_bundler import (
safe_4337_user_operation_hash_mock,
user_operation_mock,
user_operation_receipt_mock,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from django.test import TestCase

from hexbytes import HexBytes

from gnosis.eth.tests.mocks.mock_bundler import user_operation_mock
from gnosis.safe.tests.safe_test_case import SafeTestCaseMixin
from safe_eth.eth.tests.mocks.mock_bundler import user_operation_mock
from safe_eth.safe.tests.safe_test_case import SafeTestCaseMixin

from ..helpers import DecodedInitCode, decode_init_code

Expand Down
Loading

0 comments on commit 59e40bd

Please sign in to comment.