ethereum: support full range 32bit chain_id#399
Conversation
* remove chain_id restriction to support full 32bit chain_id * for chain_id > MAX_CHAIN_ID(2147483630) case, simply return signature_v
|
@prusnak please reconsider, or offer an alternative. This small, two line change is non-invasive, gets the job done in a sane way without any adverse effects. Changing chain ID is not an option. Ledger is supporting Pirl's full 32bit chain ID already. We could tell our users to buy only Ledger, as Trezor won't work for us, but we'd much rather have proper support and offer our users their own choice in hardware wallets. Please help us to make that possible. |
|
@mkrufky This two line change gets the job done for Trezor One, but not for Trezor Model T and other hardware wallets out there. If you want proper support, you'll pick a different chain_id. You fail to explain why this is not an option. There are over 2 billion possible options and yet you somehow managed to pick a number outside of this range. Tomorrow there will be a chain that picked an id that uses full 256-bits and will use your chain as an example why we should support their chain. If you insist on this very bad choice, you'll be stumbling upon problems with every possible implementation out there - all hardware and all software wallets. |
|
I don't know why exactly Pirl has chosen this specific chain id, but that choice was made long ago. Pirl is not a new network, and it is not trivial to change chain id without causing significant breakage. If we come up with a similar patch for the model T, would that help move along Trezer support? I understand your concern with this large chain id, but (to my knowledge) this is the only issue Pirl has encountered so far that couldn't be remedied by sharing a patch. We'd really like to work with Trezor as well. |
|
If someone creates a pull request adding new test cases to the unit test here: https://github.com/trezor/python-trezor/blob/master/trezorlib/tests/device_tests/test_msg_ethereum_signtx_eip155.py and fix the same issue here: https://github.com/trezor/trezor-core/blob/master/src/apps/ethereum/sign_tx.py#L141-L142 using I am willing to merge these changes. |
* remove chain_id restriction to support full 32bit chain_id. * for chain_id > MAX_CHAIN_ID(2147483630) case, simply return v signature parity. * see also trezor/trezor-mcu#399
|
Thanks! Please send PR to python-trezor with extended checks to https://github.com/trezor/python-trezor/blob/master/trezorlib/tests/device_tests/test_msg_ethereum_signtx_eip155.py |
* remove chain_id restriction to support full 32bit chain_id. * for chain_id > MAX_CHAIN_ID(2147483630) case, simply return v signature parity. * see also trezor/trezor-mcu#399
|
@prusnak // all done! and thank you again!! Trezor is a great project! |
|
Thanks, merged all in! |
chain_id > MAX_CHAIN_ID(2147483630)case, simply returnvsignature parity.with this fix Trezor can support full 32bit chain_id.
vis0or1and it can be easily detectable.signature_vat client side.chain_idsignature_vv27+v(>=27)1.6.21,01<=chain_id<=MAX_CHAIN_IDchain_id+ 35 +v(>=37)1.6.2[*] [**]1,0chain_id>MAX_CHAIN_IDv( <=1)1,0[*]: currently, official 1.6.2 firmware only support
0 < chain_id < 256correctly.[**]:
trezor:masterrepo support0 < chain_id <= MAX_CHAIN_ID.