A testing utility to run juno with our version of the blockifier that uses cairo native, and compare it to results from mainnet or from juno using the unmodified blockifier
modify TransactionToSimulate to use Option<BroadcastedTransaction> instead, which will not be sent to the RPC for simulation
currently only for L1Handler transactions
when L1 handler transactions are supported in the future, block_transaction_to_broadcasted_transaction can simply update the conversion to not return ManagerError::L1HandlerTransaction, without modifying anything else
update transaction to broadcasted transaction logic to support DeclareTransactions, which require another RPC call to retrieve the contract_class value based off of the class_hash
Examples
For block 642265 (which currently crashes), the L1Handler transaction now looks like this
Tested DEPLOY_ACCOUNT v1 and v3 in block 640092, it appears to be working where there are 3 Same(DEPLOY_ACCOUNT) instances.
Other solutions
adding a boolean is_l1_handler to TransactionToSimulate, so that we can check this field in simulate_block on top of doing an is_none() check
felt that this is unnecessary. in the event that L1 handler is supported in the future, the current solution would work by modifying block_transaction_to_broadcasted_transaction. this solution would require the removal of this boolean
update block_transaction_to_broadcasted_transaction to return an Option<BroadcastedTransaction>
similar to 1., I feel this logic would make it harder for future migration, and out of place for a marshalling / conversion method
the current solution is basically equivalent to this, without modifying the API of block_transaction_to_broadcasted_transaction
update get_transactions_to_simulate to return Result<Vec<Option<TransactionToSimulate>>, ManagerError>
doing this strips away the other fields in TransactionToSimulate that is being used in block simulation, i.e. hash and expected_result, which may be used by other consumers, even if the transaction was not sent to RPC for simulation
Fixes https://github.com/NethermindEth/blockifier-tester/issues/59
Changes
TransactionToSimulate
to useOption<BroadcastedTransaction>
instead, which will not be sent to the RPC for simulationL1Handler
transactionsblock_transaction_to_broadcasted_transaction
can simply update the conversion to not returnManagerError::L1HandlerTransaction
, without modifying anything elseDeclareTransaction
s, which require another RPC call to retrieve thecontract_class
value based off of theclass_hash
Examples
For block
642265
(which currently crashes), theL1Handler
transaction now looks like thisTested
DEPLOY_ACCOUNT
v1 and v3 in block640092
, it appears to be working where there are 3Same(DEPLOY_ACCOUNT)
instances.Other solutions
is_l1_handler
toTransactionToSimulate
, so that we can check this field insimulate_block
on top of doing anis_none()
checkblock_transaction_to_broadcasted_transaction
. this solution would require the removal of this booleanblock_transaction_to_broadcasted_transaction
to return anOption<BroadcastedTransaction>
block_transaction_to_broadcasted_transaction
get_transactions_to_simulate
to returnResult<Vec<Option<TransactionToSimulate>>, ManagerError>
TransactionToSimulate
that is being used in block simulation, i.e.hash
andexpected_result
, which may be used by other consumers, even if the transaction was not sent to RPC for simulation