Skip to content

fix(api): use params tipset-key to load the tipset for gas premium calculation#13357

Merged
rjan90 merged 2 commits into
filecoin-project:masterfrom
akaladarshi:akaladarshi/use-params-tipset-key
Sep 26, 2025
Merged

fix(api): use params tipset-key to load the tipset for gas premium calculation#13357
rjan90 merged 2 commits into
filecoin-project:masterfrom
akaladarshi:akaladarshi/use-params-tipset-key

Conversation

@akaladarshi
Copy link
Copy Markdown
Contributor

@akaladarshi akaladarshi commented Sep 23, 2025

Proposed Changes

  • Use the TipSetKey if it is provided in the API params instead of getting heaviest tipset (only use heaviest if API params doesn't have a TipSetKey)

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

Copilot AI review requested due to automatic review settings September 23, 2025 14:58
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FilOz Sep 23, 2025
@akaladarshi akaladarshi added the skip/changelog This change does not require CHANGELOG.md update label Sep 23, 2025
Copy link
Copy Markdown
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 fixes the gas premium calculation in the Filecoin API by using the provided tipset-key parameter instead of always defaulting to the heaviest tipset.

  • Updated GasEstimateFeeCap and GasEstimateGasPremium functions to accept and use the TipSetKey parameter
  • Modified API layer to pass the tsk parameter through to the underlying utility functions
  • Changed parameter names from ignored (_) to used (tsk/ts) to reflect actual usage

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
node/impl/gasutils/gasutils.go Updated core gas estimation functions to accept and use TipSetKey parameter instead of hardcoded heaviest tipset
node/impl/full/gas.go Modified API layer functions to pass through the tipset key parameter and use it in gas estimation calls

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread node/impl/gasutils/gasutils.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@akaladarshi akaladarshi requested a review from rvagg September 23, 2025 15:05
@github-project-automation github-project-automation Bot moved this from 📌 Triage to ✔️ Approved by reviewer in FilOz Sep 24, 2025
@rjan90 rjan90 merged commit 773a691 into filecoin-project:master Sep 26, 2025
175 of 176 checks passed
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FilOz Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip/changelog This change does not require CHANGELOG.md update

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

4 participants