Skip to content

test: modify estimation of tip for Devnet #1449

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

Merged
merged 1 commit into from
Jul 24, 2025

Conversation

PhilippeR26
Copy link
Collaborator

Motivation and Resolution

When executing the test suite in Devnet, we have a flood of tip error messages.
Devnet is starting from block 0 (no history of transactions) and creates a new block at each transaction. So, the default maxBlocks and minTxsNecessary are not adapted for Devnet.
This PR create a small initiial history of Devnet transactions, and is changing the default values (only for Devnet)

Usage related changes

N/A

Development related changes

  • if Devnet is just launched (zero blocks), 3 random transactions are created, with random tips, to create an initial tip history.
  • account.getEstimateTip() is overwritten when using Devnet, to use new default values:
minTxsNecessary: options.minTxsNecessary ?? 3,
maxBlocks: options.maxBlocks ?? 10,
  • To create these 3 new transactions before launching the test suite, some parts of tests/config/fixtures.ts are necessary, but Jest do not accept at this stage code including the use of subscribe. So the file has been splitted in 2 files: fixtures.ts & fixturesInit.ts.
  • When tip is estimated out of an account, the logger has been temporary set to critcal.

Tested with success in:

  • New Devnet
  • Devnet with history
  • Testnet

Note

  • wording of devnet-rs replaced by starknet-devnet.
  • prettier has automatically modified some documentation files.

Checklist:

  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Linked the issues which this PR resolves
  • Documented the changes in code (API docs will be generated automatically)
  • Updated the tests
  • All tests are passing

Copy link
Member

@tabaktoni tabaktoni left a comment

Choose a reason for hiding this comment

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

IGWT

@tabaktoni tabaktoni merged commit de590d7 into starknet-io:beta Jul 24, 2025
3 checks passed
Copy link
Contributor

🎉 This PR is included in version 8.0.0-beta.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link
Contributor

🎉 This PR is included in version 8.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants