Skip to content

Commit

Permalink
Merge pull request #126 from levonyak/PAN-2261-2262-polygon-pos-and-s…
Browse files Browse the repository at this point in the history
…onic-support

[PAN-2261] [PAN-2262] Support for Polygon and Sonic blockchains
  • Loading branch information
markuslevonyak authored Oct 21, 2024
2 parents f3b1a7a + dbd1e77 commit f511bae
Show file tree
Hide file tree
Showing 14 changed files with 1,051 additions and 941 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
.vscode/
build/
dist/
find.sh
local/
/local/
postgresql_data
rabbitmq_data
debian/.debhelper
Expand Down
18 changes: 9 additions & 9 deletions bids.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ blockchains:
- execution_time: 1200
fee: 8500000000
valid_period: 300
fantom:
sonic:
- execution_time: 600
fee: 10000000000
valid_period: 300
Expand Down Expand Up @@ -79,7 +79,7 @@ blockchains:
- execution_time: 1200
fee: 150000000
valid_period: 300
fantom:
sonic:
- execution_time: 600
fee: 200000000
valid_period: 300
Expand Down Expand Up @@ -126,7 +126,7 @@ blockchains:
- execution_time: 1200
fee: 150000000
valid_period: 300
fantom:
sonic:
- execution_time: 600
fee: 200000000
valid_period: 300
Expand Down Expand Up @@ -173,7 +173,7 @@ blockchains:
- execution_time: 1200
fee: 150000000
valid_period: 300
fantom:
sonic:
- execution_time: 600
fee: 200000000
valid_period: 300
Expand Down Expand Up @@ -220,7 +220,7 @@ blockchains:
- execution_time: 600
fee: 50000000
valid_period: 300
fantom:
sonic:
- execution_time: 600
fee: 200000000
valid_period: 300
Expand All @@ -234,7 +234,7 @@ blockchains:
- execution_time: 1200
fee: 150000000
valid_period: 300
fantom:
sonic:
ethereum:
- execution_time: 600
fee: 10000000000
Expand Down Expand Up @@ -270,7 +270,7 @@ blockchains:
- execution_time: 1200
fee: 150000000
valid_period: 300
fantom:
sonic:
- execution_time: 600
fee: 50000000
valid_period: 300
Expand Down Expand Up @@ -317,7 +317,7 @@ blockchains:
- execution_time: 1200
fee: 150000000
valid_period: 300
fantom:
sonic:
- execution_time: 600
fee: 200000000
valid_period: 300
Expand All @@ -328,4 +328,4 @@ blockchains:
- execution_time: 600
fee: 50000000
valid_period: 300


Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""Module for Fantom-specific clients and errors. Since Fantom is
"""Module for Sonic-specific clients and errors. Since Sonic is
Ethereum-compatible, the client implementation inherits from the
pantos.servicenode.blockchains.ethereum module.
Note that Pantos used to support Sonic's predecessor Fantom. This module
was renamed accordingly on 2024-10-18.
"""
from pantos.common.blockchains.enums import Blockchain

Expand All @@ -10,23 +13,23 @@
from pantos.servicenode.blockchains.ethereum import EthereumClientError


class FantomClientError(EthereumClientError):
"""Exception class for all Fantom client errors.
class SonicClientError(EthereumClientError):
"""Exception class for all Sonic client errors.
"""
pass


class FantomClient(EthereumClient):
"""Fantom-specific blockchain client.
class SonicClient(EthereumClient):
"""Sonic-specific blockchain client.
"""
@classmethod
def get_blockchain(cls) -> Blockchain:
# Docstring inherited
return Blockchain.FANTOM
return Blockchain.SONIC

@classmethod
def get_error_class(cls) -> type[BlockchainClientError]:
# Docstring inherited
return FantomClientError
return SonicClientError
1,754 changes: 931 additions & 823 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ flake8 = "7.1.1"
isort = "5.13.2"
mypy = "1.0.1"
types-pyyaml = "6.0.12.20240917"
types-requests = "^2.32.0.20240622"
types-sqlalchemy = "^1.4.53.38"
yapf = "0.40.2"

[tool.poetry.group.dev.dependencies]
pre-commit = "4.0.1"

[tool.poetry.dependencies]
python = "^3.10"
pantos-common = "3.0.0"
pantos-common = "4.0.0"
alembic = "1.13.3"
celery = "5.3.1"
Cerberus = "1.3.4"
Expand All @@ -54,8 +56,6 @@ semantic-version = "2.10.0"
gunicorn = ">=22,<24"
requests = "^2.32.3"
flower = "^2.0.1"
types-requests = "^2.32.0.20240622"
types-sqlalchemy = "^1.4.53.38"

[build-system]
requires = ["poetry-core"]
Expand Down
10 changes: 5 additions & 5 deletions service-node-config.docker.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PROTOCOL=0.1.0
AVALANCHE_ACTIVE=false

# BNB
#BNB_CHAIN_WITHDRAWAL_ADDRESS=' '
BNB_CHAIN_WITHDRAWAL_ADDRESS='0x47816331dc80AB1DdE3C221951cBa8Bf3d532e15'
BNB_CHAIN_PRIVATE_KEY_PASSWORD=''
BNB_CHAIN_PROVIDER=http://bnb:8545
BNB_CHAIN_CHAIN_ID=31338
Expand All @@ -24,15 +24,15 @@ CELO_ACTIVE=false
CRONOS_ACTIVE=false

# Ethereum
#ETHEREUM_WITHDRAWAL_ADDRESS=' '
ETHEREUM_WITHDRAWAL_ADDRESS='0x47816331dc80AB1DdE3C221951cBa8Bf3d532e15'
ETHEREUM_PRIVATE_KEY_PASSWORD=''
ETHEREUM_PROVIDER=http://eth:8545
ETHEREUM_CHAIN_ID=31337
ETHEREUM_CONFIRMATIONS=0
ETHEREUM_BLOCKS_UNTIL_RESUBMISSION=10

# Fantom
FANTOM_ACTIVE=false

# Polygon
POLYGON_ACTIVE=false

# Sonic
SONIC_ACTIVE=false
42 changes: 21 additions & 21 deletions service-node-config.env
Original file line number Diff line number Diff line change
Expand Up @@ -151,28 +151,8 @@ ETHEREUM_PRIVATE_KEY_PASSWORD='<fill me>'
# ETHEREUM_ADAPTABLE_FEE_INCREASE_FACTOR=
# ETHEREUM_BLOCKS_UNTIL_RESUBMISSION=
# ETHEREUM_DEPOSIT=
##### Section: fantom #####
# FANTOM_ACTIVE=
# FANTOM_REGISTERED=
FANTOM_WITHDRAWAL_ADDRESS='<fill me>'
# FANTOM_PRIVATE_KEY=
FANTOM_PRIVATE_KEY_PASSWORD='<fill me>'
# FANTOM_PROVIDER=
# FANTOM_FALLBACK_PROVIDER=
# FANTOM_AVERAGE_BLOCK_TIME=
# FANTOM_PROVIDER_TIMEOUT=
# FANTOM_CHAIN_ID=
# FANTOM_HUB=
# FANTOM_FORWARDER=
# FANTOM_PAN_TOKEN=
# FANTOM_CONFIRMATIONS=
# FANTOM_MIN_ADAPTABLE_FEE_PER_GAS=
# FANTOM_MAX_TOTAL_FEE_PER_GAS=
# FANTOM_ADAPTABLE_FEE_INCREASE_FACTOR=
# FANTOM_BLOCKS_UNTIL_RESUBMISSION=
# FANTOM_DEPOSIT=
##### Section: polygon #####
POLYGON_ACTIVE=false
# POLYGON_ACTIVE=
# POLYGON_REGISTERED=
POLYGON_WITHDRAWAL_ADDRESS='<fill me>'
# POLYGON_PRIVATE_KEY=
Expand Down Expand Up @@ -209,3 +189,23 @@ POLYGON_PRIVATE_KEY_PASSWORD='<fill me>'
# SOLANA_ADAPTABLE_FEE_INCREASE_FACTOR=
# SOLANA_BLOCKS_UNTIL_RESUBMISSION=
# SOLANA_DEPOSIT=
##### Section: sonic #####
# SONIC_ACTIVE=
# SONIC_REGISTERED=
SONIC_WITHDRAWAL_ADDRESS='<fill me>'
# SONIC_PRIVATE_KEY=
SONIC_PRIVATE_KEY_PASSWORD='<fill me>'
# SONIC_PROVIDER=
# SONIC_FALLBACK_PROVIDER=
# SONIC_AVERAGE_BLOCK_TIME=
# SONIC_PROVIDER_TIMEOUT=
# SONIC_CHAIN_ID=
# SONIC_HUB=
# SONIC_FORWARDER=
# SONIC_PAN_TOKEN=
# SONIC_CONFIRMATIONS=
# SONIC_MIN_ADAPTABLE_FEE_PER_GAS=
# SONIC_MAX_TOTAL_FEE_PER_GAS=
# SONIC_ADAPTABLE_FEE_INCREASE_FACTOR=
# SONIC_BLOCKS_UNTIL_RESUBMISSION=
# SONIC_DEPOSIT=
10 changes: 5 additions & 5 deletions service-node-config.local.env
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SIGNER_PEM_PASSWORD=1234
AVALANCHE_ACTIVE=false

# BNB
#BNB_CHAIN_WITHDRAWAL_ADDRESS=' '
BNB_CHAIN_WITHDRAWAL_ADDRESS='0x2310efFa6A998769585DdE983a54Ef1c09807Cd3'
# **This path is used in CI**
BNB_CHAIN_PRIVATE_KEY=/etc/pantos/keystore.bnb
BNB_CHAIN_PRIVATE_KEY_PASSWORD=''
Expand All @@ -41,7 +41,7 @@ CELO_ACTIVE=false
CRONOS_ACTIVE=false

# Ethereum
#ETHEREUM_WITHDRAWAL_ADDRESS=' '
ETHEREUM_WITHDRAWAL_ADDRESS='0x2310efFa6A998769585DdE983a54Ef1c09807Cd3'
# **This path is used in CI**
ETHEREUM_PRIVATE_KEY=/etc/pantos/keystore.eth
ETHEREUM_PRIVATE_KEY_PASSWORD=''
Expand All @@ -50,8 +50,8 @@ ETHEREUM_CHAIN_ID=31337
ETHEREUM_CONFIRMATIONS=2
ETHEREUM_BLOCKS_UNTIL_RESUBMISSION=10

# Fantom
FANTOM_ACTIVE=false

# Polygon
POLYGON_ACTIVE=false

# Sonic
SONIC_ACTIVE=false
Loading

0 comments on commit f511bae

Please sign in to comment.