fix(eip712): Fix cyclic message types handling#4650
Merged
sergei-boiko-trustwallet merged 2 commits intomasterfrom Feb 12, 2026
Merged
fix(eip712): Fix cyclic message types handling#4650sergei-boiko-trustwallet merged 2 commits intomasterfrom
sergei-boiko-trustwallet merged 2 commits intomasterfrom
Conversation
Copilot started reviewing on behalf of
sergei-boiko-trustwallet
February 10, 2026 13:30
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes EIP-712 custom type dependency resolution so cyclic type graphs don’t cause infinite traversal when building dependencies for type encoding.
Changes:
- Fix dependency traversal condition to only enqueue unseen custom types (prevents cycles from re-queuing already-seen types).
- Extend
test_build_dependenciescustom types to include aPerson↔Mailcycle.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Binary size comparison➡️ aarch64-apple-ios: 14.34 MB ➡️ aarch64-apple-ios-sim: 14.34 MB ➡️ aarch64-linux-android: 18.77 MB ➡️ armv7-linux-androideabi: 16.20 MB ➡️ wasm32-unknown-emscripten: 13.68 MB |
nikhil-gupta-tw
approved these changes
Feb 11, 2026
davidkulman-tw
approved these changes
Feb 11, 2026
perpetua-engineering
pushed a commit
to perpetua-engineering/wallet-core
that referenced
this pull request
Feb 13, 2026
* fix(eip712): Fix cyclic message types handling * fix(eip712): Add an extra test
perpetua-engineering
pushed a commit
to perpetua-engineering/wallet-core
that referenced
this pull request
Feb 25, 2026
* fix(eip712): Fix cyclic message types handling * fix(eip712): Add an extra test
perpetua-engineering
pushed a commit
to perpetua-engineering/wallet-core
that referenced
this pull request
Mar 2, 2026
* fix(eip712): Fix cyclic message types handling * fix(eip712): Add an extra test
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.
This pull request improves the handling of custom type dependencies in the EIP-712 message encoding logic, specifically to correctly handle cyclic dependencies between types. It also updates the test coverage to ensure cycles are handled without causing infinite loops.
Dependency resolution fix:
encode_custom_typemodule to correctly detect and process custom type dependencies, ensuring that cyclic dependencies (such as betweenPersonandMail) do not cause infinite loops.Test improvements:
test_build_dependenciestest to include a custom types definition with an intentional cyclic dependency betweenPersonandMail, verifying that the dependency builder can handle cycles safely.