-
Notifications
You must be signed in to change notification settings - Fork 775
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
Block, Tx: always copy Common on instantiation / Fix HF consistency bugs #1089
Conversation
…F behavior on outer common updates
…e HF behavior on outer common updates
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
7310bda
to
3cb2cc0
Compare
…dforkByBlockNumber is passed in static constructors, create blocks in blockchain with hardforkByBlockNumber option consistently
3cb2cc0
to
8e00fa2
Compare
This is the next failure now (independent from this PR): Block number 55 on Rinkeby. |
Have found another state changing error in 749b93f where we were still updating the miner account in {
stateRoot: <Buffer 9e 15 ba 99 5a a6 a3 4f 60 f4 4e 16 4d a3 de aa 75 ab e7 bb eb af cc b4 fd 44 47 b9 99 25 d1 6d>,
gasUsed: <Buffer 52 08>,
bitvector: <Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 206 more bytes>,
logs: []
} |
6f1080d
to
3fea4a3
Compare
Ok, I've now added two additional loggers Output as following: Still open for review. |
But back to the failing tx on Rinkeby (the above was just some other testing log output). So here is the log: Actually this is really a dead-simple transaction, which really puzzles me. Just a simple transfer of value. The only thing I can think of right now is something going wrong due to the very large initial account balance of |
6c4372f
to
a151f20
Compare
a151f20
to
26274d8
Compare
…patibility checks for clique functionality usage on block library, added reasonable cliqueSigner default (zero address) for default blocks
Got it. 😄 The fee reward didn't need to be removed completely (have removed the commit doing this) but instead the fees have to be provided to the signer account. VM execution is now going forward. I have also added additional backwards-compatibility checks for adding the block clique functionality in the VM as well as some reasonable default for returning a signer on default blocks (zero address), otherwise e.g. the VM would break when be run on a default block. |
Argh, guys, can someone please review this? Tomorrow I would add yet another PR on top of these two! 😀😅 |
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.
lgtm! nice fixes, and wow this new debug output looks really amazing
I think we can safe us from a load of problems when the
Common
instance in block and tx is just copied over. After months of thinking about this I am pretty much sure this is the right thing to do. Both txs and blocks just DO have a certain HF state - and if this is attached to an outerCommon
which - e.g. in the case of our client withchainCommon
- might move on or change, this will lead to consistency problems if the respective Tx or Block objects are still around.PR was triggered when running the client on Rinkeby which broke at bloke 55 with:
This is now fixed with this PR - as always replaced by another error though (
Invalid receipt trie
). Original root cause was the block being executed on the wrong HF though.I think these
Common
-copy-fix can go in as a bug fix, this will very much rather help prevent unexpected behavior within the community using the library, maybe there might be some rather unintended use cases (which should rather be discouraged) of the library where this might break, but I am pretty sure the benefits weight significantly more here.In the client as well as in the blockchain library I then switched to
hardforkByBlockNumber
block and header instantiations. This should once and for all - together with the change from above - free us from all consistency problems in this regard.I also fixed bugs along the way in
Block
where the tx objects have been instantiated with the wrong HF in the static constructors when thehardforkByBlockNumber
option has been used for block instantiation.Note that this PR is targeted towards the
client-block-poa-fixes
branch.