-
Notifications
You must be signed in to change notification settings - Fork 2
[NONEVM-2656] Contract version debugging tool #222
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
base: main
Are you sure you want to change the base?
Conversation
b3fb714
to
d636748
Compare
1a9a6a8
to
1c553bb
Compare
6ade2c4
to
b5070c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a debugging tool to search for the commit hash that corresponds to a given contract code hash by cross-referencing published artifacts. The tool connects to the TON blockchain, retrieves a contract's code hash, and searches through GitHub releases to find the matching compiled contract.
Key changes:
- Added a complete Go application for contract version debugging
- Implemented GitHub API integration to fetch releases and commit information
- Created functionality to download and parse contract artifacts from releases
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
scripts/codehash-matcher/main.go | Main application with TON RPC connection, GitHub API integration, and contract matching logic |
scripts/codehash-matcher/go.mod | Go module definition with dependencies for TON utilities |
scripts/codehash-matcher/README.md | Documentation explaining tool usage, examples, and troubleshooting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
strings.Contains(baseName, "/") || | ||
strings.Contains(baseName, "\\") || | ||
strings.Contains(baseName, "..") || | ||
strings.HasPrefix(baseName, ".") { |
Copilot
AI
Sep 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The security check to reject filenames starting with '.' may be too restrictive as it would also reject legitimate files like '.compiled.json'. Consider allowing files that end with '.compiled.json' even if they start with a dot, or adjust the logic to be more specific about which dot-prefixed files to reject.
strings.HasPrefix(baseName, ".") { | |
(strings.HasPrefix(baseName, ".") && !strings.HasSuffix(baseName, ".compiled.json")) { |
Copilot uses AI. Check for mistakes.
strings.Contains(baseName, "/") || | ||
strings.Contains(baseName, "\\") || |
Copilot
AI
Sep 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path sanitization logic has a logical issue. Since baseName
is derived from filepath.Base(header.Name)
, it should never contain '/' or '\' characters, making those checks redundant. Consider removing these redundant checks or restructuring the validation logic.
strings.Contains(baseName, "/") || | |
strings.Contains(baseName, "\\") || |
Copilot uses AI. Check for mistakes.
NONEVM-2656
Debugging tool to search the commit hash given the contract code hash and the published artifacts