Skip to content

Commit a87e56f

Browse files
Normalize BLS public keys to canonical lowercase hex
1 parent 2293825 commit a87e56f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/validators/execution.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ async def process_events(self, events: list[EventData], to_block: BlockNumber) -
3232
new_keys: set[HexStr] = set()
3333
for event in events:
3434
public_key = process_network_validator_event(event)
35+
# Track only deposit events for keys we manage
3536
if public_key and public_key in public_keys_manager.public_keys:
3637
new_keys.add(public_key)
3738

src/validators/validators.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77

88
def validate_bls_pubkey(v: HexStr) -> HexStr:
99
try:
10-
if len(Web3.to_bytes(hexstr=v)) == BLS_PUBLIC_KEY_BYTES_LENGTH:
11-
return v
10+
raw = Web3.to_bytes(hexstr=v)
11+
if len(raw) == BLS_PUBLIC_KEY_BYTES_LENGTH:
12+
return HexStr(Web3.to_hex(raw))
1213
except Exception: # nosec
1314
pass
1415

0 commit comments

Comments
 (0)