Add Spurious Dragon Hardfork#423
Conversation
|
There are two somewhat subtle points of the EIP 161.
Condition d) matters because of the following edge case:
Empty accounts with storage exist on mainnet and so getting this wrong would be a consensus issue. All clients seem to have this right though. @voith is doing some work on this PR so I'm not going to fix anything until he has finished. |
I have submitted a PR to Peters repo: petertdavies#1 |
203b375 to
c232e43
Compare
|
I have added @voith's implementation of EIP 161 to the PR. I have rebase'd out my previous version. |
|
|
Codecov Report
@@ Coverage Diff @@
## master #423 +/- ##
==========================================
+ Coverage 75.53% 79.44% +3.91%
==========================================
Files 152 187 +35
Lines 7943 9815 +1872
==========================================
+ Hits 6000 7798 +1798
- Misses 1943 2017 +74
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
|
||
| Returns | ||
| ------- | ||
| touched_accounts: `set` |
There was a problem hiding this comment.
| touched_accounts: `set` | |
| accounts_to_delete: `set` |
| Returns | ||
| ------- | ||
| touched_accounts: `set` | ||
| returns all the accounts that were touched and may need to be deleted. |
There was a problem hiding this comment.
| returns all the accounts that were touched and may need to be deleted. | |
| returns all the accounts that have been `SELFDESTRUCT`'ed |
| # collect RIPEMD160 precompile even if ancestor evm had error. | ||
| # otherwise, skip collection from children of erred-out evm objects | ||
| if evm.message.target == THREE: | ||
| # mypy is a little dumb; |
There was a problem hiding this comment.
Maybe we can get rid of this mypy error if change line 307 with:
if evm.message.target != Bytes0(b"") --> isinstance(evm.message.target, Bytes0)
(Haven't tested though)
There was a problem hiding this comment.
Would probably want isinstance(evm.message.target, Address), right?
c232e43 to
29c74ba
Compare
SamWilsn
left a comment
There was a problem hiding this comment.
I think the only major issue is the mypy ignore comment!
| # collect RIPEMD160 precompile even if ancestor evm had error. | ||
| # otherwise, skip collection from children of erred-out evm objects | ||
| if evm.message.target == THREE: | ||
| # mypy is a little dumb; |
There was a problem hiding this comment.
Would probably want isinstance(evm.message.target, Address), right?
|
@ultratwo will you be able to make the changes that sam has requested? I don't have permission to directly push. |
This patch implements the Spurious Dragon hardfork. Where appropriate refactorings have been backported to keep diffs as clean as possible.
The implementation of EIP 161 raises a number of points:
EMPTY_ACCOUNT's immediately after touching them, rather than at the end of the transaction. This should be equivalent to EIP 161, but there are complicated edge cases that I am still investigating. If neccesary this will be dealt with in a future patch.touch_account()prior to Spurious Dragon (where it was unnecessary) and have reinstated it in Spurious Dragon with a new meaning.I have increased the rate of DB commits during the Shanghai DOS attacks and the State Clearing. During these periods ~19 million empty accounts were created and then deleted and the DB cannot cope with 1000 block transactions during this time.
Diff from Tangerine Whistle
Non-spurious Komodo Dragons