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

⚡️ Faster contract execution in genesis by not running in r0vm #618

Merged
merged 3 commits into from
Jan 17, 2025

Conversation

wraitii
Copy link
Member

@wraitii wraitii commented Jan 14, 2025

No description provided.

@wraitii wraitii marked this pull request as draft January 14, 2025 17:53
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

Attention: Patch coverage is 75.14677% with 127 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/client-sdk/src/helpers.rs 8.51% 43 Missing ⚠️
crates/hyle-loadtest/src/lib.rs 0.00% 28 Missing ⚠️
crates/client-sdk/src/transaction_builder.rs 72.85% 19 Missing ⚠️
crates/contract-sdk/src/utils.rs 64.81% 19 Missing ⚠️
crates/contract-sdk/src/guest.rs 20.00% 12 Missing ⚠️
crates/contracts/staking/src/lib.rs 91.30% 4 Missing ⚠️
crates/contracts/hyllar/src/lib.rs 90.90% 2 Missing ⚠️
Files with missing lines Coverage Δ
crates/contract-sdk/src/lib.rs 51.80% <ø> (ø)
crates/contracts/hydentity/src/client.rs 100.00% <100.00%> (ø)
crates/contracts/hydentity/src/lib.rs 98.93% <100.00%> (+0.09%) ⬆️
crates/contracts/hyllar/src/client.rs 100.00% <100.00%> (+55.00%) ⬆️
crates/contracts/staking/src/client.rs 87.83% <100.00%> (+1.27%) ⬆️
crates/hyle-model/src/contract.rs 66.10% <ø> (+2.54%) ⬆️
src/genesis.rs 94.82% <100.00%> (+0.26%) ⬆️
crates/contracts/hyllar/src/lib.rs 97.11% <90.90%> (-0.62%) ⬇️
crates/contracts/staking/src/lib.rs 84.50% <91.30%> (+84.50%) ⬆️
crates/contract-sdk/src/guest.rs 38.29% <20.00%> (ø)
... and 4 more

... and 1 file with indirect coverage changes

.try_into()
.expect("Failed to decode state");

let _ = stdout.write_str("Init token contract");
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use env::log ?

Copy link
Contributor

Choose a reason for hiding this comment

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

this function doesn't seem to match the guest 🤔

@wraitii wraitii force-pushed the feat/faster_contract_execution branch from 0a4e9ab to cc48de3 Compare January 15, 2025 15:32
@wraitii wraitii marked this pull request as ready for review January 15, 2025 15:33
@wraitii wraitii force-pushed the feat/faster_contract_execution branch 2 times, most recently from 3d7d06a to 0b857ca Compare January 15, 2025 18:38
Copy link
Contributor

@maxgttph maxgttph left a comment

Choose a reason for hiding this comment

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

On en a parlé à l'oral; on utilise le statedigest des contrats comme était directement le state. Ça fait l'objet d'une autre pr pour l'adapter

crates/client-sdk/src/transaction_builder.rs Show resolved Hide resolved
@@ -175,6 +179,32 @@ impl TryFrom<sdk::StateDigest> for HyllarToken {
}
}

pub fn execute(stdout: &mut impl std::fmt::Write, contract_input: ContractInput) -> HyleOutput {
Copy link
Contributor

Choose a reason for hiding this comment

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

pourquoi pas mettre cette fonction directement dans HyllarPseudoExecutor (qu'on renommerait alors HyllarExecutor) ?


#[derive(Default)]
pub struct TxExecutor<S: StateUpdater> {
full_states: S,
Copy link
Contributor

Choose a reason for hiding this comment

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

Je trouve le nom un peu ambiguë
J"aurais appelé ça all_states, ou qulque chose qui laisse ententre que c'est le state de chaque contract dans la Tx
Le mot full donne l'impression que c'est poru dire 'state complet' imo

Copy link
Contributor

Choose a reason for hiding this comment

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

On vient d'en parler à l'oral :
Le typage des variables est confusing; il faut faire la distinction State (: Digestable) et StateDigest (et adapter les noms de variables en conséquence :p

@wraitii wraitii force-pushed the feat/faster_contract_execution branch from 0b857ca to adcf973 Compare January 17, 2025 12:32
@wraitii wraitii merged commit 8005caa into main Jan 17, 2025
11 checks passed
@wraitii wraitii deleted the feat/faster_contract_execution branch January 17, 2025 12:43
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