Refactor for the new version of the Substate#7
Open
evgensheff wants to merge 8 commits intoFantom-foundation:mainfrom
Open
Refactor for the new version of the Substate#7evgensheff wants to merge 8 commits intoFantom-foundation:mainfrom
evgensheff wants to merge 8 commits intoFantom-foundation:mainfrom
Conversation
wsodsong
reviewed
Apr 1, 2024
evmcore/state_processor.go
Outdated
Comment on lines
115
to
141
| substate.NewEnv( | ||
| stypes.Address(etherBlock.Coinbase()), | ||
| etherBlock.Difficulty(), | ||
| etherBlock.GasLimit(), | ||
| etherBlock.NumberU64(), | ||
| etherBlock.Time(), | ||
| etherBlock.BaseFee(), | ||
| innerSubstate.HashGethToSubstate(statedb.SubstateBlockHashes)), | ||
| substate.NewMessage( | ||
| msg.Nonce(), | ||
| msg.IsFake(), | ||
| msg.GasPrice(), | ||
| msg.Gas(), | ||
| stypes.Address(msg.From()), | ||
| &to, | ||
| msg.Value(), | ||
| msg.Data(), | ||
| &dataHash, | ||
| innerSubstate.AccessListGethToSubstate(msg.AccessList()), | ||
| msg.GasFeeCap(), | ||
| msg.GasTipCap()), | ||
| substate.NewResult( | ||
| receipt.Status, | ||
| receipt.Bloom.Bytes(), | ||
| innerSubstate.LogsGethToSubstate(receipt.Logs), | ||
| stypes.Address(receipt.ContractAddress), | ||
| receipt.GasUsed), |
Collaborator
There was a problem hiding this comment.
Each New function takes long arguments. I want to suggest moving them to the substate package.
Collaborator
There was a problem hiding this comment.
I see a full copy of a structure in the util function. Can you and @matejmlejnek double check on performance penalty when recording new substates?
Collaborator
There was a problem hiding this comment.
Since this is our package, please add unit tests.
| // InputLine writes the given text to the childs stdin. | ||
| // This method can also be called from an expect template, e.g.: | ||
| // | ||
| // cli.expect(`Passphrase: {{.InputLine "password"}}`) |
Collaborator
There was a problem hiding this comment.
This file seems to be modified by auto-formatting tool. I would suggest remove files which are unrelated to this change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Functions and methods changed according to the code in the develop branch