Skip to content
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

core: check if sender is EOA #23303

Merged
merged 8 commits into from Aug 7, 2021
Merged

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Jul 30, 2021

This is a rebased version of #23002. Some commits are dropped, and I didn't want to squash-delete those until I'm sure they're not needed, hence the new PR.

@holiman holiman added this to the 1.10.7 milestone Jul 30, 2021
Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

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

LGTM!

@holiman holiman merged commit 0658712 into ethereum:master Aug 7, 2021
@@ -220,6 +223,11 @@ func (st *StateTransition) preCheck() error {
st.msg.From().Hex(), msgNonce, stNonce)
}
}
// Make sure the sender is an EOA
if codeHash := st.state.GetCodeHash(st.msg.From()); codeHash != emptyCodeHash && codeHash != (common.Hash{}) {
Copy link
Member

Choose a reason for hiding this comment

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

Why did you check against the zero hash? That should never happen.

@holiman
Copy link
Contributor Author

holiman commented Aug 12, 2021 via email

sidhujag pushed a commit to sidhujag/go-ethereum that referenced this pull request Aug 15, 2021
This adds a check to verify that a sender-account does not have code, which means that the codehash is either `emptyCodeHash` _OR_ not present. The latter occurs IFF the sender did not previously exist, a situation which can only occur with zero cost gasprices.
reds pushed a commit to reds/go-ethereum that referenced this pull request Aug 28, 2021
This adds a check to verify that a sender-account does not have code, which means that the codehash is either `emptyCodeHash` _OR_ not present. The latter occurs IFF the sender did not previously exist, a situation which can only occur with zero cost gasprices.
i-norden pushed a commit to cerc-io/go-ethereum that referenced this pull request Sep 10, 2021
This adds a check to verify that a sender-account does not have code, which means that the codehash is either `emptyCodeHash` _OR_ not present. The latter occurs IFF the sender did not previously exist, a situation which can only occur with zero cost gasprices.
atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
This adds a check to verify that a sender-account does not have code, which means that the codehash is either `emptyCodeHash` _OR_ not present. The latter occurs IFF the sender did not previously exist, a situation which can only occur with zero cost gasprices.
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.

None yet

4 participants