Skip to content

Feat: Implement faster cost tracker for default cost functions #5859

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

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE

### Changed

- Implement faster cost tracker for default cost functions in Clarity
- Miner will stop waiting for signatures on a block if the Stacks tip advances (causing the block it had proposed to be invalid).
- Logging improvements:
- P2P logs now includes a reason for dropping a peer or neighbor
Expand Down
4 changes: 4 additions & 0 deletions clarity/src/vm/contexts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,10 @@ impl<'a, 'hooks> OwnedEnvironment<'a, 'hooks> {
})
}

pub fn is_mainnet(&self) -> bool {
self.context.mainnet
}

#[cfg(any(test, feature = "testing"))]
pub fn stx_faucet(&mut self, recipient: &PrincipalData, amount: u128) {
self.execute_in_env::<_, _, crate::vm::errors::Error>(
Expand Down
326 changes: 326 additions & 0 deletions clarity/src/vm/costs/cost_functions.rs

Large diffs are not rendered by default.

Loading
Loading