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 103 commits into
base: mainnet_2_3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
19e89b4
Add structure async call and async call id
AurelienFT May 9, 2024
4407e86
progress
damip May 9, 2024
b6948d0
progress
damip May 9, 2024
bcfaed3
todos
damip May 9, 2024
eb59c84
Improve general behavior
damip May 10, 2024
5315ea4
typo
damip May 10, 2024
d4300c3
reformat registry
damip May 10, 2024
60cbf28
make things compile
damip May 10, 2024
42c47cd
updates
damip May 21, 2024
37a1961
Merge remote-tracking branch 'aurelien/new_asc' into deferred_calls
modship Jul 8, 2024
94016cb
update new interface
modship Jul 8, 2024
d62dbee
deferred calls first step
modship Jul 9, 2024
d18ed1b
rename massa_asc package to massa_deferred_calls
modship Jul 9, 2024
8b3b2da
TDD for ser_deser validation
modship Jul 10, 2024
7d7e850
Test(DeferredRegistrySlotChanges) : Ser/deser
modship Jul 10, 2024
f945386
Test(DeferredRegistryChanges) : Ser/Deser
modship Jul 10, 2024
9814537
update StateChanges Deserializer
modship Jul 10, 2024
90202d3
create macros, put_entry , delete_entry on DB
modship Jul 12, 2024
698a033
refactor + get_total_gas
modship Jul 12, 2024
cfe824a
get_slot_calls && get_slot_base_fee
modship Jul 15, 2024
1a86834
add mod tests / deferred_call_quote
modship Jul 16, 2024
9d74423
get_deferred_call_quote (interface_impl)
modship Jul 16, 2024
e1f2eca
register call
modship Jul 17, 2024
1bcc026
register set gas
modship Jul 17, 2024
14ca8d5
deferred_call_cancel
modship Jul 17, 2024
4a0c7db
execute deferred call, advance_slot, snapshot
modship Jul 24, 2024
ee901f1
execution trace && execution info
modship Jul 24, 2024
693cf0e
delete call from DB
modship Jul 24, 2024
43923d1
slot remaining gas for async msg
modship Jul 25, 2024
e94c57f
in case of fail, refound sender
modship Jul 25, 2024
6297693
get_slot from DeferredCallId
modship Jul 25, 2024
8bbb687
Fix(ser/deser): error and update test
modship Jul 26, 2024
801e65c
Fix(exec_deferred_call) : Fix lock
modship Jul 26, 2024
d59a556
Test(deferred_call) : first execution test
modship Jul 26, 2024
cd44aa1
fix(deferred_call) : remove double delete_call
modship Jul 26, 2024
cc14cdc
Test(abi) : First test for register deferred_call
modship Jul 29, 2024
1668f4d
Test(register) : more assert
modship Jul 30, 2024
24e09fe
Fix(set_total_gas) : fix set / keep
modship Jul 31, 2024
64f6c24
Test(deferred_call) : Register call fail (total_gas)
modship Jul 31, 2024
9a022ef
Fix(execution) : cancel deferred on check target sc + test refound
modship Jul 31, 2024
08bbef2
update wasm file
modship Jul 31, 2024
9fb3c0e
Fix(deferred_call) : fix compute call fee
modship Aug 1, 2024
82938ec
Fix(deferred_call) : some fix
modship Aug 1, 2024
3ce418f
Test(deferred_call) : Add slot base fee
modship Aug 1, 2024
baa1c3a
rename DEFERRED_CALLS_SLOT_PREFIX to DEFERRED_CALLS_PREFIX
modship Aug 14, 2024
87bb3a2
deferred calls ser/deser error msg
modship Aug 14, 2024
1dcab48
deferred_call_id deserializer limit
modship Aug 14, 2024
ac7ccde
models error
modship Aug 14, 2024
ebe33e1
update max_async_gas for async msg
modship Aug 16, 2024
12971b5
remove useless condition
modship Aug 16, 2024
1d61d14
overbooking_fee return Result
modship Aug 16, 2024
8f82d3e
fix operator
modship Aug 16, 2024
6c1caec
add penalty constant
modship Aug 16, 2024
f3331b5
pr comment # 1
modship Aug 26, 2024
9664ca7
Update massa-execution-worker/src/context.rs
modship Aug 26, 2024
a08664e
pr comment # 2
modship Aug 26, 2024
b53c77f
create DeferredCallsConfig
modship Aug 26, 2024
91ac5e3
use config struct
modship Aug 27, 2024
fe347bb
clippy
modship Aug 27, 2024
07863fc
allow unused_macros
modship Aug 27, 2024
5f28f44
fix : massa-bootstrap import
modship Aug 27, 2024
fd69b2e
wrap deferred call execution into a closure
modship Aug 28, 2024
67ad55f
update sc runtime && wasm test file
modship Aug 28, 2024
6815f44
update interface params from bytes to string
modship Aug 29, 2024
db87465
first metrics
modship Aug 29, 2024
d49dda7
Test: Add check on total_gas after execution
modship Aug 29, 2024
f43fdea
Test : Add 2nd call in scenario and check total_gas
modship Aug 30, 2024
5a58f5f
move type Set Update Delete from Ledger to massa_models
modship Sep 2, 2024
3f5f3cc
remove todo
modship Sep 3, 2024
4df7053
add vm allocation gas cost
modship Sep 4, 2024
c8ca2a8
remove todo
modship Sep 5, 2024
3dcd4ab
Fee: calc relu_occupancy_before
modship Sep 5, 2024
b5dae7c
update sc runtime
modship Sep 5, 2024
89c4d1d
add abi gas cost
modship Sep 5, 2024
039e9ba
Fix : total gas booked
modship Sep 6, 2024
562c16f
BugFix && add nb_call_registered
modship Sep 18, 2024
9583fc7
API : Jsonrpc DeferredCallQuote
modship Sep 20, 2024
341db02
API : JsonRpc get_deferred_call_info && list_deferred_calls_by_slot
modship Sep 23, 2024
4f7524d
API : openrpc spec
modship Sep 24, 2024
5b68c00
grpc api
modship Sep 26, 2024
815ed4c
Fix grpc log error
modship Sep 27, 2024
fd9d945
API : Update list call ids by slot
modship Sep 27, 2024
ed88731
rename openrpc method
modship Sep 27, 2024
7cd95b3
Fix : reset_to_snapshot
modship Oct 1, 2024
08be8a9
Fix: reset_to_snapshot
modship Oct 1, 2024
bc225ec
FIX : Api double alloc vm cst
modship Oct 2, 2024
a4e21a3
Fix : compute_fee get_effective_total_gas()
modship Oct 2, 2024
a4f3a6d
Update runtime
modship Oct 2, 2024
34d9975
Fix abi gas cost
modship Oct 2, 2024
9e57b53
Test : compute_call_fee setup && first basic test
modship Oct 2, 2024
6d25ee6
Test : add test for deferred call exists
modship Oct 3, 2024
2aea5a0
clippy
modship Oct 3, 2024
46fccbe
Fix : fee calculation
modship Oct 7, 2024
8ebf906
add storage cost for deferred call
modship Oct 16, 2024
2af6725
Merge remote-tracking branch 'origin/mainnet_2_3' into deferred_calls
modship Oct 18, 2024
88ecb0d
Storage: Refund sender (storage cost for params)
modship Oct 18, 2024
ff28375
Test : deferred call quote
modship Oct 21, 2024
64f4cdb
update runtime
modship Oct 21, 2024
95e1bc8
Fix all feature && update runtime
modship Oct 21, 2024
c8e45d8
fix doc
modship Oct 21, 2024
2453a80
Update storage cost for deferred calls and set MAX_FUNCTION_NAME_LENG…
modship Oct 30, 2024
1ef9d71
Fix comment
modship Oct 30, 2024
dd31e59
condom limits default with gas_calibration
modship Nov 7, 2024
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
57 changes: 23 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ massa_consensus_exports = { path = "./massa-consensus-exports" }
massa_consensus_worker = { path = "./massa-consensus-worker" }
massa_db_exports = { path = "./massa-db-exports" }
massa_db_worker = { path = "./massa-db-worker" }
massa_deferred_calls = { path = "./massa-deferred-calls" }
massa_executed_ops = { path = "./massa-executed-ops" }
massa_execution_exports = { path = "./massa-execution-exports" }
massa_execution_worker = { path = "./massa-execution-worker" }
Expand Down Expand Up @@ -107,7 +108,9 @@ massa_wallet = { path = "./massa-wallet" }

# Massa projects dependencies
massa-proto-rs = { git = "https://github.com/massalabs/massa-proto-rs", "rev" = "38950875a7aa406fedc4f0b8336864e5ff290f2c" }
massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", "rev" = "80352eb9f2a6b90a441cd64433d8874c33fb384f" }
massa-sc-runtime = { git = "https://github.com/massalabs/massa-sc-runtime", "rev" = "116dd8a32819c8def8a5aa014f805ee2cab9f384" }


peernet = { git = "https://github.com/massalabs/PeerNet", "rev" = "04b05ddd320fbe76cc858115af7b5fc28bdb8310" }

# Common dependencies
Expand Down
4 changes: 4 additions & 0 deletions massa-bootstrap/src/tests/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use massa_consensus_exports::{
bootstrapable_graph::BootstrapableGraph, export_active_block::ExportActiveBlock,
};
use massa_db_exports::{DBBatch, ShareableMassaDBController, StreamBatch};
use massa_deferred_calls::DeferredCallRegistry;
use massa_executed_ops::{
ExecutedDenunciations, ExecutedDenunciationsChanges, ExecutedDenunciationsConfig, ExecutedOps,
ExecutedOpsConfig,
Expand Down Expand Up @@ -275,6 +276,8 @@ pub fn get_random_final_state_bootstrap(
.write()
.write_batch(batch, versioning_batch, None);

let deferred_call_registry = DeferredCallRegistry::new(db.clone());

let executed_ops = get_random_executed_ops(
r_limit,
slot,
Expand Down Expand Up @@ -304,6 +307,7 @@ pub fn get_random_final_state_bootstrap(
config,
Box::new(final_ledger),
async_pool,
deferred_call_registry,
pos_state,
executed_ops,
executed_denunciations,
Expand Down
5 changes: 5 additions & 0 deletions massa-db-exports/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub const LEDGER_PREFIX: &str = "ledger/";
pub const MIP_STORE_PREFIX: &str = "versioning/";
pub const MIP_STORE_STATS_PREFIX: &str = "versioning_stats/";
pub const EXECUTION_TRAIL_HASH_PREFIX: &str = "execution_trail_hash/";
pub const DEFERRED_CALLS_PREFIX: &str = "deferred_calls/";

// Async Pool
pub const MESSAGE_DESER_ERROR: &str = "critical: message deserialization failed";
Expand Down Expand Up @@ -56,3 +57,7 @@ pub const EXECUTED_DENUNCIATIONS_INDEX_SER_ERROR: &str =
pub const KEY_DESER_ERROR: &str = "critical: key deserialization failed";
pub const KEY_SER_ERROR: &str = "critical: key serialization failed";
pub const KEY_LEN_SER_ERROR: &str = "critical: key length serialization failed";

// deferred calls
pub const DEFERRED_CALL_DESER_ERROR: &str = "critical: message deserialization failed";
pub const DEFERRED_CALL_SER_ERROR: &str = "critical: message serialization failed";
22 changes: 22 additions & 0 deletions massa-deferred-calls/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "massa_deferred_calls"
version = "2.2.0"
authors = ["Massa Labs <[email protected]>"]
edition = "2021"

[features]
test-exports = []
sandbox = []

[dependencies]
serde = { workspace = true, "features" = ["derive"] }
nom = { workspace = true }
massa_db_exports = { workspace = true }
massa_ledger_exports = { workspace = true }
massa_models = { workspace = true }
massa_serialization = { workspace = true }

[dev-dependencies]
tempfile = { workspace = true }
massa_db_worker = { workspace = true }
parking_lot = { workspace = true }
Loading
Loading