Skip to content
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

fix: allow setting min gas price in launchNode args #2814

Merged
merged 4 commits into from
Jul 22, 2024

Conversation

mvares
Copy link
Contributor

@mvares mvares commented Jul 22, 2024

Summary

In the previous solution, the minGasPrice was already defined by default. This PR fixes it by basing it on the params.

Checklist

  • I addedtests to prove my changes
  • I updated — all the necessary docs
  • I reviewed — the entire PR myself, using the GitHub UI
  • I described — all breaking changes and the Migration Guide

@petertonysmith94 petertonysmith94 dismissed their stale review July 22, 2024 12:51

Incorrect approval

Copy link
Contributor

@Torres-ssf Torres-ssf left a comment

Choose a reason for hiding this comment

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

@mvares Thanks for this contribution 👍

We are almost there, we only need to remove the --min-gas-price from the informed args.

This is required based on your solution, otherwise the --min-gas-price will still be used twice.

You simply need to edit the call to extractRemainingArgs at the launchNode function.

    const remainingArgs = extractRemainingArgs(args, [
      '--snapshot',
      '--consensus-key',
      '--db-type',
      '--poa-instant',
      '--min-gas-price', // <- needs to be added here
      '--native-executor-version', // Please can you also add this missing flag?
    ]);

@mvares mvares requested a review from Torres-ssf July 22, 2024 13:29
Copy link
Contributor

@Torres-ssf Torres-ssf left a comment

Choose a reason for hiding this comment

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

@mvares It would be good if we could also add a test to validate the changes made here.

Let's unskip and change this test case here to:

  it('should ensure estimated fee values on getTransactionCost are never 0', async () => {
    using launched = await setupTestProviderAndWallets({
      nodeOptions: {
        args: ['--min-gas-price', '0'],
      },
    });
    const { provider } = launched;
    const request = new ScriptTransactionRequest();

    const { minFee, maxFee, gasPrice } = await provider.getTransactionCost(request);

    expect(gasPrice.eq(0)).toBeTruthy();

    expect(maxFee.eq(0)).not.toBeTruthy();
    expect(minFee.eq(0)).not.toBeTruthy();
  });

@arboleya arboleya removed the p2 label Jul 22, 2024
@mvares
Copy link
Contributor Author

mvares commented Jul 22, 2024

:shipit:

@mvares mvares requested a review from Torres-ssf July 22, 2024 13:47
@Torres-ssf Torres-ssf changed the title fix: support minimum gas price in args fix: allow setting minimum gas price in launchNode args Jul 22, 2024
@Torres-ssf Torres-ssf changed the title fix: allow setting minimum gas price in launchNode args fix: allow setting min gas price in launchNode args Jul 22, 2024
Copy link
Contributor

@Torres-ssf Torres-ssf left a comment

Choose a reason for hiding this comment

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

@mvares This is the last one

.changeset/mighty-crews-vanish.md Outdated Show resolved Hide resolved
@arboleya arboleya merged commit 83bcfcf into FuelLabs:master Jul 22, 2024
20 checks passed
@mvares mvares deleted the m/fix/min-gas-price-arg branch July 22, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make launchNode Support Min Gas Price
5 participants