-
Notifications
You must be signed in to change notification settings - Fork 170
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
Add VM concurrency support #2059
base: main
Are you sure you want to change the base?
Conversation
Tested by running {
"jsonrpc":"2.0",
"method":"starknet_traceTransaction",
"params":["0x5634f2847140263ba59480ad4781dacc9991d0365145489b27a198ebed2f969"],
"id":1
} Response body {
"jsonrpc": "2.0",
"result": {
"type": "INVOKE",
"execute_invocation": {
"contract_address": "0x31c9cdb9b00cb35cf31c05855c0ec3ecf6f7952a1ce6e3c53c3455fcd75a280",
"calldata": [
"0x20cfa74ee3564b4cd5435cdace0f9c4d43b939620e4a0bb5076105df0a626c6",
"0x5aee31408163292105d875070f98cb48275b8c87e80380b78d30647e05854d5"
],
"caller_address": "0x0",
"result": [],
"calls": [
{
"contract_address": "0x20cfa74ee3564b4cd5435cdace0f9c4d43b939620e4a0bb5076105df0a626c6",
"calldata": [
"0x5aee31408163292105d875070f98cb48275b8c87e80380b78d30647e05854d5",
"0x7e5"
],
"caller_address": "0x31c9cdb9b00cb35cf31c05855c0ec3ecf6f7952a1ce6e3c53c3455fcd75a280",
"result": [],
"calls": [],
"events": [],
"messages": [],
"execution_resources": { "steps": 25 }
},
{
"contract_address": "0x20cfa74ee3564b4cd5435cdace0f9c4d43b939620e4a0bb5076105df0a626c6",
"calldata": [
"0x5aee31408163292105d875070f98cb48275b8c87e80380b78d30647e05854d5"
],
"caller_address": "0x31c9cdb9b00cb35cf31c05855c0ec3ecf6f7952a1ce6e3c53c3455fcd75a280",
"result": ["0x7e5"],
"calls": [],
"events": [],
"messages": [],
"execution_resources": { "steps": 31 }
}
],
"events": [],
"messages": [],
"execution_resources": { "steps": 178 }
}
},
"id": 1
} |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2059 +/- ##
=======================================
Coverage 78.47% 78.47%
=======================================
Files 100 100
Lines 9234 9235 +1
=======================================
+ Hits 7246 7247 +1
Misses 1350 1350
Partials 638 638 ☔ View full report in Codecov by Sentry. |
530d149
to
f7f7a60
Compare
The current problem is this bug. It happened in sequential mode.
|
f7f7a60
to
2f33d5a
Compare
To make it work in my branch:
{
"id": 1,
"jsonrpc": "2.0",
"method": "starknet_estimateFee",
"params": {
"request": [
{
"type": "INVOKE",
"sender_address": "0xf9e998b2853e6d01f3ae3c598c754c1b9a7bd398fec7657de022f3b778679",
"calldata": [
"0x1",
"0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf",
"0x1987cbd17808b9a23693d4de7e246a443cfe37e6e7fbaeabd7d7e6532b07c3d",
"0x4",
"0x16342ade8a7cc8296920731bc34b5a6530f5ee1dc1bfd3cc83cb3f519d6530a",
"0x77295b07f4b1d4e4fdb18b26faf95d5bdb0087da065b7b0b49d0470d9cbf852",
"0x1",
"0x0"
],
"version": "0x100000000000000000000000000000001",
"signature": [],
"nonce": "0x2a91",
"max_fee": "0x0"
}
],
"block_id": "pending",
"simulation_flags": [
"SKIP_VALIDATE"
]
}
} |
Pathfinder team encountered the same problem |
It would be good to add a test for the concurrency mode if possible. Also curious what the performance of simulating a block in concurrency mode is as well. |
2f33d5a
to
792fc56
Compare
I tried to measure performance by running multiple transactions and found a new bug. |
913f964
to
dd5ec08
Compare
This commit changes cairoVMExecute. It doesn't use the `charge_fee` and `validate` variables. It converts the `TxnAndQueryBit` objects to the `Transaction` objects expected by the TransactionExecutor, uses the `execute_txs` method of the `TransactionExecutor` to execute all transactions (concurrently or not). After execution, it handles the results, including errors, rolled back transactions, and trace logging, according to the original logic.
dd5ec08
to
a053ddc
Compare
Fixes #2016
This PR adds a new flag,
VMConcurrencyMode
and changescairoVMExecute
.