-
Notifications
You must be signed in to change notification settings - Fork 5
NONEVM-3462: devenv smoke testing #535
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
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 enables TON smoke testing in the development environment by updating dependencies and fixing price configuration issues. The changes address failures in go mod tidy and missing LINK token price configuration that were preventing successful smoke test execution.
Changes:
- Updated chainlink core version reference to resolve dependency conflicts
- Fixed LINK token price configuration in the TON fee quoter
- Re-enabled smoke test workflow with improved logging
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/.core_version | Updated core version hash to resolve dependency issues |
| devenv/onchain.go | Added LINK token price calculation and simplified state loading |
| .github/workflows/test-smoke.yml | Re-enabled TON smoke tests and added workflow run URL logging |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Calculate LINK token price (20 USD with 1e18 precision) | ||
| // LINK has 9 decimals on TON, similar to Solana | ||
| linkTokenPrice := big.NewInt(0).Mul(big.NewInt(20), big.NewInt(1e18)) | ||
| linkTokenPrice = linkTokenPrice.Mul(linkTokenPrice, big.NewInt(1e10)) // Scale to 1e28 |
Copilot
AI
Jan 21, 2026
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 multiplication operation mutates linkTokenPrice and then multiplies it by itself (since Mul's receiver is also the first operand), resulting in linkTokenPrice² * 1e10 instead of the intended linkTokenPrice * 1e10. Use a new variable or swap the operands: linkTokenPrice = big.NewInt(0).Mul(linkTokenPrice, big.NewInt(1e10))
| linkTokenPrice = linkTokenPrice.Mul(linkTokenPrice, big.NewInt(1e10)) // Scale to 1e28 | |
| linkTokenPrice = big.NewInt(0).Mul(linkTokenPrice, big.NewInt(1e10)) // Scale to 1e28 |
| const TONtoUSD = 2 // Example value | ||
| const TONtoNanoTON = 1e9 // Smallest denomination | ||
| const TokenPriceBaseAmount = 1e18 // Defined for `TokenPrices` | ||
| var USDDecimals = big.NewInt(1e18) // Defined for `TokenPrices` | ||
|
|
||
| // Calculate TON token price | ||
| var TONBaseAmountTokenPrice = big.NewInt(int64(TONtoUSD * (TokenPriceBaseAmount / TONtoNanoTON))) | ||
| tonTokenPrice := big.NewInt(0).Mul(TONBaseAmountTokenPrice, USDDecimals) | ||
|
|
||
| // Calculate LINK token price (20 USD with 1e18 precision) | ||
| // LINK has 9 decimals on TON, similar to Solana | ||
| linkTokenPrice := big.NewInt(0).Mul(big.NewInt(20), big.NewInt(1e18)) | ||
| linkTokenPrice = linkTokenPrice.Mul(linkTokenPrice, big.NewInt(1e10)) // Scale to 1e28 |
Copilot
AI
Jan 21, 2026
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 comment states 'LINK has 9 decimals on TON' but the scaling factor of 1e10 applied to a base of 1e18 suggests different precision handling. The relationship between the 9 decimals, the 1e18 base amount, and the 1e10 scaling factor should be clarified to explain why 1e28 is the target precision.
| const TONtoUSD = 2 // Example value | |
| const TONtoNanoTON = 1e9 // Smallest denomination | |
| const TokenPriceBaseAmount = 1e18 // Defined for `TokenPrices` | |
| var USDDecimals = big.NewInt(1e18) // Defined for `TokenPrices` | |
| // Calculate TON token price | |
| var TONBaseAmountTokenPrice = big.NewInt(int64(TONtoUSD * (TokenPriceBaseAmount / TONtoNanoTON))) | |
| tonTokenPrice := big.NewInt(0).Mul(TONBaseAmountTokenPrice, USDDecimals) | |
| // Calculate LINK token price (20 USD with 1e18 precision) | |
| // LINK has 9 decimals on TON, similar to Solana | |
| linkTokenPrice := big.NewInt(0).Mul(big.NewInt(20), big.NewInt(1e18)) | |
| linkTokenPrice = linkTokenPrice.Mul(linkTokenPrice, big.NewInt(1e10)) // Scale to 1e28 | |
| const TONtoUSD = 2 // Example value | |
| const TONtoNanoTON = 1e9 // Smallest denomination | |
| const TokenPriceBaseAmount = 1e18 // Base amount used for TokenPrices, in 1e18 USD precision | |
| const TokenPricePrecisionScale = 1e10 // Additional scale so that TokenPrices use 1e28 precision (1e18 * 1e10) | |
| var USDDecimals = big.NewInt(1e18) // USD values are expressed with 1e18 precision | |
| // Calculate TON token price | |
| var TONBaseAmountTokenPrice = big.NewInt(int64(TONtoUSD * (TokenPriceBaseAmount / TONtoNanoTON))) | |
| tonTokenPrice := big.NewInt(0).Mul(TONBaseAmountTokenPrice, USDDecimals) | |
| // Calculate LINK token price: | |
| // - Start from 20 USD represented with 1e18 USD precision. | |
| // - LINK has 9 decimals on TON, but TokenPrices are normalized to 1e28 precision | |
| // (1e18 USD precision * TokenPricePrecisionScale = 1e28), independent of token decimals. | |
| linkTokenPrice := big.NewInt(0).Mul(big.NewInt(20), big.NewInt(1e18)) | |
| linkTokenPrice = linkTokenPrice.Mul(linkTokenPrice, big.NewInt(TokenPricePrecisionScale)) // Scale USD value to 1e28 TokenPrices precision |
| } | ||
|
|
||
| // Token price constants | ||
| const TONtoUSD = 2 // Example value |
Copilot
AI
Jan 21, 2026
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 comment 'Example value' suggests this is a placeholder rather than a real price. If this is production code, it should use actual price feed data or be clearly documented as a test/development constant.
| const TONtoUSD = 2 // Example value | |
| const TONtoUSD = 2 // Test/development placeholder value; do NOT use in production (use a real price feed or config instead) |
Testing devenv go mod tidy failure, suspecting outdated chainlink-ton deps in core
dc62ef9(#535)