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

Coretime: Add request revenue info #3940

Merged
merged 128 commits into from
Jun 26, 2024
Merged

Conversation

antonva
Copy link
Contributor

@antonva antonva commented Apr 2, 2024

Enables the request_revenue and notify_revenue parts of RFC 5 - Coretime Interface

TODO:

  • Finish first pass at implementation
  • Need to explicitly burn uncollected and dropped revenue Accumulate it instead
  • Confirm working on zombienet
  • Tests
  • Enable XCM request_revenue sending on Coretime chain on Kusama and Polkadot

Fixes: #2209

Comment on lines +249 to +250
let value =
Balances::reducible_balance(&stash, Preservation::Expendable, Fortitude::Polite);
Copy link
Member

Choose a reason for hiding this comment

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

I would probably just take all of it, but not that important here for the test chain.

polkadot/runtime/parachains/src/assigner_on_demand/mod.rs Outdated Show resolved Hide resolved

message.push(mk_coretime_call::<T>(CoretimeCalls::NotifyRevenue((when, raw_revenue))));

send_xcm::<T::SendXcm>(dest.clone(), Xcm(message))?;
Copy link
Contributor

Choose a reason for hiding this comment

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

We know that this will send with Root privilege? It will be necessary for the UnpaidExecution instruction. IMO this is where testing with xcm-emulator is worth it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, it works in manual zombienet tests and in integration tests, so I guess it's likely to be okay... But if someone could make it through the emulator that would be great!

polkadot/runtime/parachains/src/mock.rs Outdated Show resolved Hide resolved
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable 1/3
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6561980

@s0me0ne-unkn0wn s0me0ne-unkn0wn added this pull request to the merge queue Jun 26, 2024
Merged via the queue into master with commit f1db2c6 Jun 26, 2024
154 of 158 checks passed
@s0me0ne-unkn0wn s0me0ne-unkn0wn deleted the ava-request-revenue-info branch June 26, 2024 17:12
@ggwpez
Copy link
Member

ggwpez commented Jul 14, 2024

How do i integrate this into a runtime? PRdoc and or MR description should provide some integration advise for downstream teams.

@s0me0ne-unkn0wn
Copy link
Contributor

How do i integrate this into a runtime? PRdoc and or MR description should provide some integration advise for downstream teams.

Well, it's a fair point, although I doubt the PRdoc is a good place for it... Anyway, I was going to start a PR in the fellowship repo to integrate it into Kusama first.

TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Aug 2, 2024
Enables the `request_revenue` and `notify_revenue` parts of [RFC 5 -
Coretime
Interface](https://polkadot-fellows.github.io/RFCs/approved/0005-coretime-interface.html)

TODO:
- [x] Finish first pass at implementation
- [x] ~~Need to explicitly burn uncollected and dropped revenue~~
Accumulate it instead
- [x] Confirm working on zombienet
- [x] Tests 
- [ ] Enable XCM `request_revenue` sending on Coretime chain on Kusama
and Polkadot

Fixes: paritytech#2209

---------

Co-authored-by: Dmitry Sinyavin <[email protected]>
Co-authored-by: command-bot <>
Co-authored-by: s0me0ne-unkn0wn <[email protected]>
Co-authored-by: Dónal Murray <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
@@ -22200,34 +22185,31 @@ dependencies = [

[[package]]
name = "time"
version = "0.3.36"
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why time upgrade had to be reverted, but it created compilation issues that was fixed in #4862, so stable2407 is broken on nightly again. Does no one review lock file changes or what?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah that was an oversight. Downstream users should not have the problem as they can just upgrade the patch version. When you compile the stable in the repo, there is no other way around than bumping this locally for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T14-system_parachains This PR/Issue is related to system parachains.
Projects
Status: Audited
Development

Successfully merging this pull request may close these issues.

Request revenue info
10 participants