Skip to content

Commit 84654a4

Browse files
authored
Add deposit root check just before transaction (#233)
* Add deposit root check just before transaction Signed-off-by: cyc60 <avsysoev60@gmail.com> * Increase HOT_WALLET_MIN_BALANCE Signed-off-by: cyc60 <avsysoev60@gmail.com> --------- Signed-off-by: cyc60 <avsysoev60@gmail.com>
1 parent 13db5fe commit 84654a4

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/config/networks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def IS_SUPPORT_V2_MIGRATION(self) -> bool:
8686
SECONDS_PER_BLOCK=Decimal(12),
8787
GENESIS_FORK_VERSION=Web3.to_bytes(hexstr=HexStr('0x00000000')),
8888
IS_POA=False,
89-
HOT_WALLET_MIN_BALANCE=Web3.to_wei('0.01', 'ether'),
89+
HOT_WALLET_MIN_BALANCE=Web3.to_wei('0.03', 'ether'),
9090
SHAPELLA_FORK_VERSION=Web3.to_bytes(hexstr=HexStr('0x03000000')),
9191
SHAPELLA_EPOCH=194048,
9292
),
@@ -114,7 +114,7 @@ def IS_SUPPORT_V2_MIGRATION(self) -> bool:
114114
SECONDS_PER_BLOCK=Decimal(12),
115115
GENESIS_FORK_VERSION=Web3.to_bytes(hexstr=HexStr('0x01017000')),
116116
IS_POA=False,
117-
HOT_WALLET_MIN_BALANCE=Web3.to_wei('0.01', 'ether'),
117+
HOT_WALLET_MIN_BALANCE=Web3.to_wei('0.03', 'ether'),
118118
SHAPELLA_FORK_VERSION=Web3.to_bytes(hexstr=HexStr('0x01017000')),
119119
SHAPELLA_EPOCH=256,
120120
),
@@ -148,7 +148,7 @@ def IS_SUPPORT_V2_MIGRATION(self) -> bool:
148148
SECONDS_PER_BLOCK=Decimal(12),
149149
GENESIS_FORK_VERSION=Web3.to_bytes(hexstr=HexStr('0x00001020')),
150150
IS_POA=True,
151-
HOT_WALLET_MIN_BALANCE=Web3.to_wei('0.01', 'ether'),
151+
HOT_WALLET_MIN_BALANCE=Web3.to_wei('0.03', 'ether'),
152152
SHAPELLA_FORK_VERSION=Web3.to_bytes(hexstr=HexStr('0x03001020')),
153153
SHAPELLA_EPOCH=162304,
154154
),
@@ -177,7 +177,7 @@ def IS_SUPPORT_V2_MIGRATION(self) -> bool:
177177
SECONDS_PER_BLOCK=Decimal('6.8'),
178178
GENESIS_FORK_VERSION=Web3.to_bytes(hexstr=HexStr('0x00000064')),
179179
IS_POA=False,
180-
HOT_WALLET_MIN_BALANCE=Web3.to_wei('0.01', 'ether'),
180+
HOT_WALLET_MIN_BALANCE=Web3.to_wei('0.03', 'ether'),
181181
SHAPELLA_FORK_VERSION=Web3.to_bytes(hexstr=HexStr('0x0')),
182182
SHAPELLA_EPOCH=0, # todo
183183
),

src/validators/tasks.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
logger = logging.getLogger(__name__)
4242

4343

44-
# pylint: disable-next=too-many-locals
44+
# pylint: disable-next=too-many-locals,too-many-branches
4545
async def register_validators(
4646
keystores: Keystores,
4747
remote_signer_config: RemoteSignerConfiguration | None,
@@ -140,6 +140,12 @@ async def register_validators(
140140
e.threshold,
141141
', '.join(e.failed_endpoints),
142142
)
143+
# compare validators root just before transaction to reduce reverted calls
144+
if registry_root != await validators_registry_contract.get_registry_root():
145+
logger.info(
146+
'Registry root has changed during validators registration. Retrying...',
147+
)
148+
return
143149

144150
if len(validators) == 1:
145151
validator = validators[0]

0 commit comments

Comments
 (0)