Skip to content

Refactor for the new version of the Substate#7

Open
evgensheff wants to merge 8 commits intoFantom-foundation:mainfrom
evgensheff:eugene/refactor
Open

Refactor for the new version of the Substate#7
evgensheff wants to merge 8 commits intoFantom-foundation:mainfrom
evgensheff:eugene/refactor

Conversation

@evgensheff
Copy link

Functions and methods changed according to the code in the develop branch

@evgensheff evgensheff requested a review from andrecronje as a code owner March 29, 2024 08:34
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),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each New function takes long arguments. I want to suggest moving them to the substate package.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"}}`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file seems to be modified by auto-formatting tool. I would suggest remove files which are unrelated to this change.

@evgensheff evgensheff requested a review from wsodsong April 4, 2024 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants