-
-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type-checking for Ethereum app #1794
Conversation
ISTM the reason for disallowing |
836d619
to
e282662
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't been able to spot any problem. Together with the Stellar PR this makes core more than 70% typed:ok_hand: What about the zero chain_id?
i'm trying to ask around if there are reasons for/against chain_id 0 |
further information on chain_id 0: haven't read through it all yet |
Conclusion seems to be: Pre-EIP-155 transactions can currently be used deliberately to produce cross-chain-replayable transactions. So by forcing EIP-155 on Trezor, we disallow the cross-chain usecase. |
If this PR gets approved, will the next release of the Firmware also include an updated version of Trezor Connect? |
Final decision about chain_id:
I also reorganized the sanity checks somewhat, so that @mmilata PTAL at the new commits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New changes ACK.
* Changes from original PR * Now that we are rejecting chain_ids of 0, we need to have the tests set the chain_ids to at least 1. * Ran 'make gen' and uploaded changed files. * Ran make style_check and fixed reported errors * Added changelog files * Reverted changes concerning chain_id 0 being rejected. * Adds tests for MAX_CHAIN_ID and MAX_CHAIN_ID+1. Also reverts MAX_CHAIN_ID to the previous value. * Added missing whitespace around arithmetic operator. Co-authored-by: Michael Hatton <michaelhatton@Michaels-Mini.fios-router.home>
now that Wanchain has proper chainID and we don't need to detect it by magic. [no changelog]
so that we can avoid Optional types for fields
16df0d6
to
800ae5c
Compare
includes #1771 which was already reviewed (2b3b75d)
includes and supersedes #1781 which already had a review from @prusnak
there are following protobuf changes:
chain_id
is enlarged touint64
. This is fully backwards-compatible.chain_id
is set torequired
. This removes support for non-EIP-155 networks. Our support database is keyed to EIP-155 chain_id, so we do not officially support any non-EIP-155 network. It's unclear if any exist at all.core
should probably disallowchain_id==0
. It's not invalid per se, far as I could find out, but per this comment it will probably simply not work with libraries. T1 already disallows it.gas_price
andgas_limit
set torequired
. Both T1 and TT had checks that would reject messages withgas_price
orgas_limit
unset, so while it's an incompatible change on the protobuf level, we know that no app could possibly have been sending such messages.required
that we know were required already (parameters to sign/verify, data chunk in TxAck...)UI diff: https://satoshilabs.gitlab.io/-/trezor/trezor-firmware/-/jobs/1556349947/artifacts/master_diff/index.html
the data_streaming case differs because we're specifying chain_id 1 so the transfer registers as Ethereum (previously UNKN)
TODO:
chain_id >= 1