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

Add mintV2 loadtest #1285

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

GeorgeTsagk
Copy link
Member

Description

This is a lighter version of the mintTest, which also uses a few more configuration parameters to control how minting occurs. We now mint normal assets into a fixed total number of groups.

This was originally intended as a rewrite of the existing mint test, but it is introduced as a totally separate function. We could keep both functions and even try to run them in parallel at some point.

The minter is fixed to Alice node, as Bob could not mint into a group that is controlled by Alice. So fixing this role to Alice makes things much simpler.

@GeorgeTsagk GeorgeTsagk self-assigned this Jan 9, 2025
@coveralls
Copy link

coveralls commented Jan 9, 2025

Pull Request Test Coverage Report for Build 12997637530

Details

  • 0 of 2 (0.0%) changed or added relevant lines in 1 file are covered.
  • 33 unchanged lines in 8 files lost coverage.
  • Overall coverage increased (+0.001%) to 40.718%

Changes Missing Coverage Covered Lines Changed/Added Lines %
itest/utils.go 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
tappsbt/create.go 2 53.22%
tapgarden/planter.go 2 64.98%
tapchannel/aux_leaf_signer.go 2 43.08%
asset/asset.go 2 77.06%
asset/mock.go 3 92.42%
tapgarden/caretaker.go 4 68.11%
tapdb/multiverse.go 6 68.21%
universe/interface.go 12 51.95%
Totals Coverage Status
Change from base Build 12992630782: 0.001%
Covered Lines: 26753
Relevant Lines: 65703

💛 - Coveralls

With the new mintV2 test we add a few extra parameters to the config
file. In this PR we expose the new parameters in the sample config and
add them to the config struct definition.
We make the WaitForNTxsInMempool function public as it's going to be
needed in the mintV2 loadtest.
We add a new mintV2 test which mints normal assets of a configured
supply into a fixed number of groups. This is an enhanced and more
lightweight version of the previous mint test, as it uses less
assertions and rpc calls.
@GeorgeTsagk GeorgeTsagk requested review from guggero and ffranr January 27, 2025 20:29
@GeorgeTsagk GeorgeTsagk changed the title Add mint V2 loadtest Add mintV2 loadtest Jan 27, 2025
Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Nice, tACK 🎉


var assetRequests []*mintrpc.MintAssetRequest

t.Logf("Minting %v assets into group %s", cfg.BatchSize, tweakedKey)
Copy link
Member

Choose a reason for hiding this comment

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

nit: %x.

mintNewGroup(t, ctx, bitcoinClient, minter, cfg)
}

// If there's not any existing groups we skip the rest of the steps, we
Copy link
Member

Choose a reason for hiding this comment

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

grammar nit: "If there aren't any existing groups".

}

// nolint:lll
assetRequests := []*mintrpc.MintAssetRequest{
Copy link
Member

Choose a reason for hiding this comment

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

nit: can remove a level of indentation by formatting as:

	assetRequests := []*mintrpc.MintAssetRequest{{
		Asset: &mintrpc.MintAsset{
			AssetType: taprpc.AssetType_NORMAL,
			Name: fmt.Sprintf(
				"tapcoin-%d", time.Now().UnixNano(),
			),
			AssetMeta: &taprpc.AssetMeta{
				Data: []byte("{}"),
				Type: taprpc.AssetMetaType_META_TYPE_JSON,
			},
			Amount:          mintAmt,
			NewGroupedAsset: true,
			DecimalDisplay:  4,
		},
	}}

That way we don't need the lll nolint directive. Same below.

defer cancel()

finalizeReq := &mintrpc.FinalizeBatchRequest{}
// Instruct the daemon to finalize the batch.
Copy link
Member

Choose a reason for hiding this comment

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

nit: newline before comment block.

Copy link
Contributor

@ffranr ffranr left a comment

Choose a reason for hiding this comment

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

I've looked at these changes. I'm not sure if I understand the motivation for this sort of load test. Will sync offline.

Comment on lines +13 to +17
# Max supply per asset mint.
mint-test-supply-max=500000

# Min supply per asset mint.
mint-test-supply-min=100000
Copy link
Contributor

Choose a reason for hiding this comment

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

What do we mean by "supply" here? Asset amounts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

4 participants