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

Owen/wasm gas meter #1792

Merged
merged 24 commits into from
Jun 7, 2024
Merged

Conversation

yubing744
Copy link
Collaborator

@yubing744 yubing744 commented Jun 2, 2024

Summary

Implement WASM runtime gas metering through custom meter host function

Copy link

vercel bot commented Jun 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rooch-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2024 11:49pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Visit Preview Jun 6, 2024 11:49pm

Copy link

vercel bot commented Jun 5, 2024

@yubing744 is attempting to deploy a commit to the Rooch Team on Vercel.

A member of the Team first needs to authorize it.

@yubing744
Copy link
Collaborator Author

@jolestar help review.

@jolestar
Copy link
Contributor

jolestar commented Jun 6, 2024

@steelgeek091 help review

let gas_meter = Arc::new(Mutex::new(GasMeter::new(GAS_LIMIT)));

// Create and configure the compiler
let mut compiler_config = wasmer::Cranelift::default();
Copy link
Collaborator

@steelgeek091 steelgeek091 Jun 6, 2024

Choose a reason for hiding this comment

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

Using wasmer-compiler-singlepass instead of cranelift will improve compilation speed, increasing it by up to 100 times in large file tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, I'll test it.

state.push_operator(operator.clone());
}
}
Operator::CallIndirect {
Copy link
Collaborator

@steelgeek091 steelgeek091 Jun 6, 2024

Choose a reason for hiding this comment

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

Some indirect calls that should not occur and should be intercepted at runtime.

@jolestar jolestar merged commit 6ec8375 into rooch-network:main Jun 7, 2024
11 checks passed
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