Floodgate: do not remove twice 0x from secret key hex
What
This MR fixes the Floodgate secret key parsing by removing one 0x prefix stripping (it was duplicated).
Why
The current implementation incorrectly removes the "0x" prefix from hexadecimal secret keys and performs duplicated validation. This causes issues when the secret key parsing function expects the full hex string including the prefix, leading to parsing failures.
How
-
Simplified hex parsing: Avoid stripping the "0x" prefix in the
signerparameter for non gcp sks. -
Direct parsing: Pass the raw hex string directly to
Signer.secret_key_from_hexfunction, letting it handle the proper format validation
The fix ensures that secret keys are parsed correctly as the underlying parsing function is already designed to remove the "0x" prefix appropriately.
Manually testing the MR
In two distinct terminals, run the following.
./octez-evm-node run sandbox --fund 0x6ce4d79d4E77402e1ef3417Fdda433aA744C6e1c --kernel evm_kernel.wasm --data-dir /tmp/b6883188-fadb-462a-bb43-4095e5e1cfde
make build-floodgate && ./floodgate run --relay-endpoint http://localhost:8545 --rpc-endpoint http://localhost:8545 --controller 0x9722f6cc9ff938e63f8ccb74c3daa6b45837e5c5e3835ac08c44c50ab5f39dc0 -m 10 --txs-per-salvo 10
Before this MR:
Error
Wrong value for command line option --controller.
9722f6cc9ff938e63f8ccb74c3daa6b45837e5c5e3835ac08c44c50ab5f39dc0 is not a valid hexa-encoded secret key
After it works as expected.
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR