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

feat(core): EOA sender validation (EIP-3607) #4849

Merged
merged 2 commits into from
Feb 24, 2025

Conversation

sunwavesun
Copy link

@sunwavesun sunwavesun commented Feb 14, 2025

Changes

  • Implemented core logic for EOA validation based on EIP-3607
  • Added unit tests to cover EOA validation and preCheck functionality

Cause

This update enhances security by preventing contract accounts from sending transactions directly, aligning with the EIP-3607 standard. It addresses inconsistencies in sender validation logic within the core module. Notably, staking messages are still exempt from the EOA check, as Harmony permits multisig accounts (which are non-EOAs) to send staking messages.

How to Test

  • Run make go-test to verify all unit tests pass
  • Run go test -run ^TestPreCheck$ github.com/harmony-one/harmony/core for the specific unit test

Notes:

This PR was based on an earlier version (#4840) but has been updated and cleaned up.

@sophoah
Copy link
Contributor

sophoah commented Feb 17, 2025

hey @sunwavesun can you add unit test for NewStakingMessage.

@sunwavesun
Copy link
Author

sunwavesun commented Feb 18, 2025

@sophoah updated the unit tests to cover NewStakingMessage. The previous unit tests for staking messages are still passing, as well as the rosetta checkers.

@sophoah
Copy link
Contributor

sophoah commented Feb 19, 2025

@Frozen thanks for review/approval

@sunwavesun sunwavesun merged commit 713f6f9 into feature/updated-mesage-struct-as-eth Feb 24, 2025
4 checks passed
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.

3 participants