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

feat: global contract distribution using receipts #12793

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stedfn
Copy link
Contributor

@stedfn stedfn commented Jan 24, 2025

No description provided.

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 23.14050% with 93 lines in your changes missing coverage. Please review.

Project coverage is 70.50%. Comparing base (77f19f7) to head (d9b8747).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
runtime/runtime/src/lib.rs 0.00% 26 Missing ⚠️
core/primitives/src/receipt.rs 13.63% 19 Missing ⚠️
runtime/runtime/src/actions.rs 0.00% 13 Missing ⚠️
chain/chain/src/chain.rs 61.53% 10 Missing ⚠️
runtime/runtime/src/balance_checker.rs 14.28% 6 Missing ⚠️
tools/state-viewer/src/contract_accounts.rs 0.00% 6 Missing ⚠️
core/primitives/src/views.rs 0.00% 4 Missing ⚠️
chain/chain/src/runtime/tests.rs 62.50% 3 Missing ⚠️
chain/chain/src/test_utils.rs 0.00% 2 Missing ⚠️
runtime/runtime/src/congestion_control.rs 0.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12793      +/-   ##
==========================================
- Coverage   70.51%   70.50%   -0.02%     
==========================================
  Files         846      846              
  Lines      174906   175047     +141     
  Branches   174906   175047     +141     
==========================================
+ Hits       123341   123419      +78     
- Misses      46311    46374      +63     
  Partials     5254     5254              
Flag Coverage Δ
backward-compatibility 0.16% <0.00%> (-0.01%) ⬇️
db-migration 0.16% <0.00%> (-0.01%) ⬇️
genesis-check 1.35% <0.00%> (-0.01%) ⬇️
linux 69.10% <23.14%> (-0.05%) ⬇️
linux-nightly 70.13% <23.14%> (-0.01%) ⬇️
pytests 1.64% <0.00%> (-0.01%) ⬇️
sanity-checks 1.46% <0.00%> (-0.01%) ⬇️
unittests 70.34% <23.14%> (-0.02%) ⬇️
upgradability 0.20% <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.

@stedfn stedfn requested a review from pugachAG January 24, 2025 12:43
@stedfn stedfn marked this pull request as ready for review January 24, 2025 12:43
@stedfn stedfn requested a review from a team as a code owner January 24, 2025 12:43

impl fmt::Debug for GlobalContractData {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("GlobalContractData").finish()
Copy link
Contributor

Choose a reason for hiding this comment

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

include code hash and id here

)]
pub struct GlobalContractData {
#[serde_as(as = "Base64")]
pub code: Vec<u8>,
Copy link
Contributor

Choose a reason for hiding this comment

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

let's use Arc<[u8]> to avoid copying contracts when routing receipt to all shards

@@ -98,6 +100,7 @@ fn total_accounts_balance(
enum PostponedReceiptType {
Action,
PromiseYield,
GlobalContractDistribution,
Copy link
Contributor

Choose a reason for hiding this comment

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

global contract distribution receipt cannot be postponed since it doesn't have any dependencies

@@ -138,6 +138,7 @@ pub(crate) enum ActionType {
Delegate,
DeployGlobalContract,
UseGlobalContract,
GlobalContractDistributionReceipt,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not an action hence it should not have a dedicated ActionType

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.

2 participants