Skip to content

Conversation

@mkmccarty
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings December 28, 2025 16:00
@mkmccarty mkmccarty merged commit e9bd741 into main Dec 28, 2025
14 checks passed
@mkmccarty mkmccarty deleted the mm-branch-1 branch December 28, 2025 16: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 updates the contract duration estimation logic to incorporate dynamic timer token rates based on each contract's MinutesPerToken field, replacing the previously hardcoded token generation rate of 6 tokens per hour.

Key Changes

  • Modified getContractDurationEstimate function to accept the full EggIncContract object as a parameter to access MinutesPerToken
  • Introduced dynamic token rate calculation based on MinutesPerToken instead of using a hardcoded value
  • Updated all call sites in boost_import.go to pass the contract object to the estimation function

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/boost/estimate_time.go Added contract parameter to getContractDurationEstimate and implemented dynamic token rate calculation using MinutesPerToken field
src/boost/boost_import.go Updated both call sites to pass the contract object as the first parameter to getContractDurationEstimate

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


est.boundedELR = bestTotal
eggsTotal := contractEggsTotal / 1e15
timerTokens := float64(c.MinutesPerToken) / 60.0
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be a dimensional analysis error in the token rate calculation. Line 435 computes timerTokens as hours per token (minutes / 60), while the base rate 6.0 on line 436 represents tokens per hour. Adding these two quantities together (hours/token + tokens/hour) is dimensionally inconsistent.

If the intent is to calculate the token generation rate in tokens per hour based on MinutesPerToken, the formula should likely be tokenRate := 60.0 / float64(c.MinutesPerToken) instead. Additionally, this would require a check to prevent division by zero when MinutesPerToken is 0, as seen in other parts of the codebase (e.g., track.go:375).

Suggested change
timerTokens := float64(c.MinutesPerToken) / 60.0
timerTokens := 0.0
if c.MinutesPerToken > 0 {
timerTokens = 60.0 / float64(c.MinutesPerToken)
}

Copilot uses AI. Check for mistakes.
Comment on lines +474 to +478
rampUpHours += (est.boostTokens / tokenRate) + (10.0 / 60.0)
} else {
// 5 tokens to boost at a rate of 6 tokens per hour
// Boost time is 13.5 minutes to boost
rampUpHours += (est.boostTokens / 6.0) + boostTime
rampUpHours += (est.boostTokens / tokenRate) + boostTime
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calculation est.boostTokens / tokenRate expects tokenRate to be in units of tokens per hour (since boostTokens is a count and the result should be time). However, the current formula on line 436 produces a dimensionally inconsistent value. This will cause incorrect ramp-up time calculations in the contract duration estimates.

Copilot uses AI. Check for mistakes.
Comment on lines 476 to 477
// 5 tokens to boost at a rate of 6 tokens per hour
// Boost time is 13.5 minutes to boost
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states "5 tokens to boost at a rate of 6 tokens per hour", but with the introduction of timer tokens via MinutesPerToken, this rate is no longer fixed at 6 tokens per hour. The comment should be updated to reflect that the rate is now dynamic based on contract-specific timer token settings.

Suggested change
// 5 tokens to boost at a rate of 6 tokens per hour
// Boost time is 13.5 minutes to boost
// Use contract-specific boost tokens and token accrual rate
// Additional boost time is dynamically calculated in boostTime

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.

2 participants