-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Implement EIP-1344: CHAINID opcode in LegacyVM #5696
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5696 +/- ##
=========================================
+ Coverage 63.02% 63.1% +0.08%
=========================================
Files 353 353
Lines 30120 30164 +44
Branches 3378 3380 +2
=========================================
+ Hits 18984 19036 +52
+ Misses 9907 9903 -4
+ Partials 1229 1225 -4 |
cd67aa9
to
0241a7f
Compare
963d65a
to
127fb8f
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.
Looks ok, but was this EIP accepted?
@chfast It was not, I think it's better not to merge until it is. |
Under discussion this Friday. Should have a yay/nay from that. |
Was accepted for Istanbul as of the call today, however @karalabe made the suggestion that implementations should reference a hard-coded value of chain ID present in the client instead of the value provided by EIP-155 compatible transactions (which the reference implementation uses) |
@fubuloubu This is what we already do here - returning constant value from chain config. |
I'll disable account versioning for Istanbul before merging this. |
Are there consensus tests for this new opcode in https://github.com/ethereum/tests yet? |
No. Somebody on it? |
Don't think so, but I can help with that. Two test scenarios I can think of:
|
I think this is a good case to create a template tests for new opcode. by template I mean construction of tests with following scenarios:
OPCODE OOG and so on ideas... |
Rebased. |
Rebased. |
the chainid is parsed from genesis config, right? |
@winsvega Yes, in aleth it is. For testeth see my comment in the PR description. |
looks like chainid is unreasonable for state tests. we just moved all blockchain specific logic tests into blockchain test suite. and now for chainid in state tests we will need to reimplement mock function again. chainid and network are two different parameters. moreover for blockchain tests it will require test format change as well. I would like to seal the current state of tests before doing this changes. |
No, we just need to agree on the chainid for statetests and blockchain tests. |
https://eips.ethereum.org/EIPS/eip-1344
Note that it activatesAccount versioning is disabled now in Istanbul.CHAINID
for version1
, that isCHAINID
works only in contracts newly-deployed with external transaction after Istanbul fork.@winsvega Note the changes in testeth: for now I leave it to
CHAINID
always returning zero in tests. To make it work properly, you'd need to put correct chainID (read from config) intoEnvInfo
s used there. It seemed not very trivial to change it in this PR, because of state tests running with several configs for each test and other complications in testeth code.