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

Deferred calls #4723

Draft
wants to merge 102 commits into
base: mainnet_2_3
Choose a base branch
from
Draft

Deferred calls #4723

wants to merge 102 commits into from

Conversation

modship
Copy link
Member

@modship modship commented Jul 9, 2024

  • document all added functions
  • try in sandbox /simulation/labnet
    • if part of node-launch, checked using the resync_check flag
  • unit tests on the added/changed features
    • make tests compile
    • make tests pass
  • add logs allowing easy debugging in case the changes caused problems
  • if the API has changed, update the API specification

@modship modship added the Massa Foundation Mandated by the Massa Foundation label Sep 24, 2024
@modship modship changed the base branch from main to mainnet_2_3 October 18, 2024 10:42
.storage_costs_constants
.ledger_cost_per_byte
.saturating_mul_u64(call.parameters.len() as u64);
context.transfer_coins(None, Some(call.sender_address), amount, false)?;
Copy link
Member

@damip damip Oct 29, 2024

Choose a reason for hiding this comment

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

in what case does the "?" trigger in this case ?

if call.cancelled {
Ok(result)
} else {
let deferred_call_execution = || {
Copy link
Member

Choose a reason for hiding this comment

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

maybe extract this to another function for better clarity

@@ -486,10 +493,22 @@ impl SpeculativeDeferredCallRegistry {
self.config.slot_overbooking_penalty, // total_initial_coin_supply/10000
)?;

// Storage cost for the parameters
let storage_cost = self
Copy link
Member Author

Choose a reason for hiding this comment

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

add total cost of call

/// deferred call min gas increment (1 nanomassa)
pub const DEFERRED_CALL_MIN_GAS_INCREMENT: u64 = 1;
/// deferred call max gas cost (10 nanomassa)
pub const DEFERRED_CALL_MIN_GAS_COST: u64 = 10;

Choose a reason for hiding this comment

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

Is this DEFERRED_CALL_MIN_GAS_COST or the MAX as written in the commented part?

Copy link
Member Author

Choose a reason for hiding this comment

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

Is this DEFERRED_CALL_MIN_GAS_COST or the MAX as written in the commented part?

Hello @plouis01, indeed it is an error in the comment, I will update it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues related to the API enhancement New feature or request Massa Foundation Mandated by the Massa Foundation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Develop autonomous contract with guaranteed execution on massa core
5 participants