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

[Test] Execution cost. #2379

Merged
merged 4 commits into from Mar 20, 2024
Merged

[Test] Execution cost. #2379

merged 4 commits into from Mar 20, 2024

Conversation

d0cd
Copy link
Contributor

@d0cd d0cd commented Mar 5, 2024

This PR follows on #2369 with two tests checking that the finalize cost is calculated correctly.
The finalize cost of an execution is the finalize cost of its root transition.
This should be equal to the sum of the cost of all commands in each finalize block in each transition in the execution.
As a by product, this PR also refactors the cost utilities to support command_cost which returns the cost of a command.

@d0cd d0cd requested a review from howardwu March 5, 2024 03:32
Comment on lines 25 to 36
const CAST_BASE_COST: u64 = 500;
const CAST_PER_BYTE_COST: u64 = 30;
const HASH_BASE_COST: u64 = 10_000;
const HASH_PER_BYTE_COST: u64 = 30;
const HASH_BHP_BASE_COST: u64 = 50_000;
const HASH_BHP_PER_BYTE_COST: u64 = 300;
const HASH_PSD_BASE_COST: u64 = 40_000;
const HASH_PSD_PER_BYTE_COST: u64 = 75;
const MAPPING_BASE_COST: u64 = 10_000;
const MAPPING_PER_BYTE_COST: u64 = 10;
const SET_BASE_COST: u64 = 10_000;
const SET_PER_BYTE_COST: u64 = 100;
Copy link
Member

Choose a reason for hiding this comment

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

Why did this get moved?

@howardwu
Copy link
Member

howardwu commented Mar 8, 2024

Why does this PR touch non-test code?

@howardwu howardwu closed this Mar 8, 2024
@d0cd d0cd reopened this Mar 9, 2024
@d0cd d0cd requested a review from howardwu March 9, 2024 01:38
Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com>
@howardwu howardwu merged commit dd01117 into mainnet-staging Mar 20, 2024
0 of 75 checks passed
@howardwu howardwu deleted the test/execution-cost branch March 20, 2024 15:06
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.

None yet

2 participants