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

yield_resume: fix resume per-byte cost #12192

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

nagisa
Copy link
Collaborator

@nagisa nagisa commented Oct 7, 2024

This was intended to match the cost of the per-byte of function call payloads, but an unfortunate two-letter typo led to it becoming the same as the base cost instead.

This change requires a protocol version bump (to 73) but otherwise is fairly straightforward in that I just set the cost of the fee to the incorrect value back in 67 and corrected it in code and protocol version 73.

@nagisa nagisa requested a review from a team as a code owner October 7, 2024 20:29
@nagisa nagisa requested review from Longarithm and saketh-are and removed request for Longarithm October 7, 2024 20:29
@@ -390,7 +390,7 @@ impl ExtCosts {
ExtCosts::yield_create_base => Parameter::WasmYieldCreateBase,
ExtCosts::yield_create_byte => Parameter::WasmYieldCreateByte,
ExtCosts::yield_resume_base => Parameter::WasmYieldResumeBase,
ExtCosts::yield_resume_byte => Parameter::WasmYieldResumeBase,
Copy link
Collaborator

@saketh-are saketh-are Oct 7, 2024

Choose a reason for hiding this comment

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

oh 🥲

@@ -147,7 +147,7 @@ wasm_alt_bn128_g1_sum_element 5_000_000_000
wasm_yield_create_base 153_411_779_276
wasm_yield_create_byte 15_643_988
wasm_yield_resume_base 1_195_627_285_210
wasm_yield_resume_byte 47_683_715
wasm_yield_resume_byte 1_195_627_285_210
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this right? Perhaps I don't understand what parameters.snap is supposed to do.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So, this is a snapshot of the parameters that we have at the current stable protocol version. I hadn't updated the protocol version in the previous revision, but I have done so now so the snapshot has been updated.

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.60%. Comparing base (6b76ee6) to head (e304c94).
Report is 29 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12192      +/-   ##
==========================================
+ Coverage   71.57%   71.60%   +0.02%     
==========================================
  Files         821      824       +3     
  Lines      165303   165513     +210     
  Branches   165303   165513     +210     
==========================================
+ Hits       118314   118510     +196     
- Misses      41852    41881      +29     
+ Partials     5137     5122      -15     
Flag Coverage Δ
backward-compatibility 0.17% <0.00%> (-0.01%) ⬇️
db-migration 0.17% <0.00%> (-0.01%) ⬇️
genesis-check 1.25% <0.00%> (-0.01%) ⬇️
integration-tests 38.73% <100.00%> (+0.07%) ⬆️
linux 71.39% <100.00%> (+0.02%) ⬆️
linux-nightly 71.17% <100.00%> (+0.03%) ⬆️
macos 54.14% <100.00%> (+0.36%) ⬆️
pytests 1.57% <0.00%> (+0.05%) ⬆️
sanity-checks 1.38% <0.00%> (+0.05%) ⬆️
unittests 65.33% <100.00%> (+0.03%) ⬆️
upgradability 0.21% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ppca ppca linked an issue Oct 7, 2024 that may be closed by this pull request
This was intended to match the cost of the per-byte of function call
payloads, but an unfortunate two-letter typo led to it becoming the same
as the base cost instead.

This change requires a protocol version bump (to 73) but otherwise is
fairly straightforward in that I just set the cost of the fee to the
incorrect value back in 67 and corrected it in code and protocol version
73.
@nagisa nagisa enabled auto-merge October 8, 2024 07:56
@nagisa nagisa added this pull request to the merge queue Oct 8, 2024
Merged via the queue into near:master with commit 7b6fae6 Oct 8, 2024
28 of 30 checks passed
@nagisa nagisa deleted the fix-yield-resume-fees branch October 8, 2024 08:37
@@ -2,4 +2,4 @@ yield_resume: { old: false, new: true }
wasm_yield_create_base: { old: 300_000_000_000_000, new: 153_411_779_276 }
wasm_yield_create_byte: { old: 300_000_000_000_000, new: 15_643_988 }
wasm_yield_resume_base: { old: 300_000_000_000_000, new: 1_195_627_285_210 }
wasm_yield_resume_byte: { old: 300_000_000_000_000, new: 17_212_011 }
wasm_yield_resume_byte: { old: 300_000_000_000_000, new: 1_195_627_285_210 }
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you modify an old config? Even if unused it seems like a bad practice.

Copy link
Collaborator

Choose a reason for hiding this comment

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

IIUC we were processing this config file the wrong way because of the bug in core/parameters/src/cost.rs. Now that we process it correctly we need to change the old file to maintain correct replayability.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As described. The fee for byte between 67 and 73 was factually 1.195Tg and this change reflects the reality. I could have added a new parameter altogether, but that would have required a change in 67 anyway (though it would have been entirely additive.)

Copy link
Contributor

Choose a reason for hiding this comment

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

omg, of course, thanks for clarifying

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.

respond() call is too expensive.
3 participants