interledger / settlement-engines

Interledger Settlement Engines written in Rust
12 stars 9 forks source link

eth_engine chain_id does not support large values like 1337 #16

Open nanuuki opened 5 years ago

nanuuki commented 5 years ago

Short summary: A chain_id larger than 255 does not work and results in an invalid sender error when trying to settle.

Commit hash or branch: master / 0f13e34f000163ce759be0fd037fcdc3448659a8

How to reproduce the bug: Spin up a local Ethereum development chain with geth and set the chain id to 1337. Configure a settlement engine to use that w/ chain_id 1337.

Description: chain_id is a u8 at the moment (https://github.com/interledger-rs/settlement-engines/blob/master/src/engines/ethereum_ledger/eth_engine.rs#L1110-L1112), but for instance the default geth development chain id is 1337. Also there's a bunch of other chains using large values for the chain id (https://github.com/ethereum-lists/chains).

Suggestion: Make the chain_id a u16 or even a u32 to enhance compatibility :)

gakonst commented 5 years ago

Yeah I'm aware of that, I have tried that in the past however RLP traits are not implemented for u16/u32. Thanks for opening the ticket, I'll get to it at a later point in time. If you want to take a stab, let me know!