Skip to content

multiply non-single execution spends by the number of participants#19666

Merged
EasterTheBunny merged 4 commits intodevelopfrom
CRE-1007/capability-don-metering-support
Oct 8, 2025
Merged

multiply non-single execution spends by the number of participants#19666
EasterTheBunny merged 4 commits intodevelopfrom
CRE-1007/capability-don-metering-support

Conversation

@EasterTheBunny
Copy link
Copy Markdown
Contributor

@EasterTheBunny EasterTheBunny commented Oct 1, 2025

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 6, 2025

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@EasterTheBunny EasterTheBunny marked this pull request as ready for review October 6, 2025 18:34
@EasterTheBunny EasterTheBunny requested review from a team as code owners October 6, 2025 18:34
Comment thread core/scripts/go.mod Outdated
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20250930202440-88c08e65d960
github.com/smartcontractkit/chainlink-common v0.9.6-0.20251002161429-f0c57dab20d5
github.com/smartcontractkit/chainlink-common v0.9.6-0.20251006170433-415d51d8f72b
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

there have been other bumps of common, so lets just make sure we pull from develop before merging so we dont regress by accident

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was the tip of develop at the time of the last commit. The merge will be blocked anyways by a merge conflict on common.

metadata.CapDON_N = 1
}

if !isGasSpendType(unit) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/nit add ticket num where we handle this more flexibly by injecting whether or not its a single execution cap into the wf registry config?

}

if !isGasSpendType(unit) {
value = value.Mul(decimal.NewFromUint64(uint64(metadata.CapDON_N)))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we cast to uint32 prior, now uint64 here - should the type in the proto be set to the equivalent of a unit64 to streamline all these conversions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Many of the libraries in Go tend to use the 64 bit variants. It might make sense to streamline as 64 bit if memory size isn't an issue.

}

stepDetails.Nodes = nodeDetails
stepDetails.CapdonN = step.CapDONN
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could we standardize the variable casing? its a lil tricky to read

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The grpc generated code does camel case but I don't know a way to get upper case inside the name like CapDON. The idiomatic Go casing is to capitalize words like DON and URL. We could certainly pick the grpc variant since we don't really have control of it and end up with strange casing throughout due to the effects of code generation.

AggSpendValue: "42.0000000000",
AggSpendUnit: billing.ResourceType_RESOURCE_TYPE_COMPUTE.String(),
AggSpendValueCre: "84.0000000000",
AggSpendValueCre: "840.0000000000",
Copy link
Copy Markdown
Contributor

@patrickhuie19 patrickhuie19 Oct 6, 2025

Choose a reason for hiding this comment

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

do we have corresponding coverage for gas?

i.e. a Settle call on where the number of credits is not multiplied by CapDON_N because its gas?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It does, but I'll make it a more explicit test to communicate the purpose better.

@EasterTheBunny EasterTheBunny force-pushed the CRE-1007/capability-don-metering-support branch from c99d816 to 78e514f Compare October 7, 2025 16:33
{Peer2PeerID: "lmno", SpendUnit: billing.ResourceType_RESOURCE_TYPE_COMPUTE.String(), SpendValue: "12"},
}}))

expected[stepRef] = &eventspb.MeteringReportStep{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how is expected used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is used in a direct equality check with the output of FormatReport

assert.Equal(t, expected, report.FormatReport().Steps)

@cl-sonarqube-production
Copy link
Copy Markdown

@EasterTheBunny EasterTheBunny added this pull request to the merge queue Oct 8, 2025
Merged via the queue into develop with commit 3f91174 Oct 8, 2025
197 of 199 checks passed
@EasterTheBunny EasterTheBunny deleted the CRE-1007/capability-don-metering-support branch October 8, 2025 17:04
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.

3 participants