Skip to content

Conversation

@jadepark-dev
Copy link
Collaborator

@jadepark-dev jadepark-dev commented Jan 19, 2026

@jadepark-dev jadepark-dev changed the title devenv: testing NONEVM-3462: devenv smoke testing Jan 20, 2026
@jadepark-dev jadepark-dev marked this pull request as ready for review January 21, 2026 17:00
@jadepark-dev jadepark-dev requested a review from a team as a code owner January 21, 2026 17:00
Copilot AI review requested due to automatic review settings January 21, 2026 17:00
Copy link
Contributor

Copilot AI left a 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
Copy link

Copilot AI Jan 21, 2026

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))

Suggested change
linkTokenPrice = linkTokenPrice.Mul(linkTokenPrice, big.NewInt(1e10)) // Scale to 1e28
linkTokenPrice = big.NewInt(0).Mul(linkTokenPrice, big.NewInt(1e10)) // Scale to 1e28

Copilot uses AI. Check for mistakes.
Comment on lines 31 to +43
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
Copy link

Copilot AI Jan 21, 2026

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
}

// Token price constants
const TONtoUSD = 2 // Example value
Copy link

Copilot AI Jan 21, 2026

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
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.

1 participant