You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
When doing a RPC call to a specific contract entry point, there is no transaction context, because there is no transaction, just a call. Nevertheless CallEntryPoint::execute method takes an EntryPointExecutionContext as an argument, which contains a TransactionContext which has a field of type TransactionContext.
As you can see there, the lib users end up passing a default, empty TransactionContext. Pathfinder is doing it, we are doing it too in Madara.
This is a clear sign of a design flaw. Either the execute method should be changed to take two separated args block_context: BlockContext and tx_info: Option<TransactionInfo> or the tx_info fields of the TransactionContext should be changed to be optional.
It then becomes a bit weird to keep this type named TransactionContext, when it is also used for calls, which are not transactions. Maybe ExecutionContext would be better, or EntrypointExecutionContext to be more explicit.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When doing a RPC
call
to a specific contract entry point, there is no transaction context, because there is no transaction, just a call. NeverthelessCallEntryPoint::execute
method takes anEntryPointExecutionContext
as an argument, which contains aTransactionContext
which has a field of typeTransactionContext
.https://github.com/eqlabs/pathfinder/blob/e4ed0d0f24803bda31dd62c072fa75d7ab5657b3/crates/executor/src/call.rs#L51
As you can see there, the lib users end up passing a default, empty
TransactionContext
. Pathfinder is doing it, we are doing it too in Madara.This is a clear sign of a design flaw. Either the
execute
method should be changed to take two separated argsblock_context: BlockContext
andtx_info: Option<TransactionInfo>
or thetx_info
fields of theTransactionContext
should be changed to be optional.It then becomes a bit weird to keep this type named
TransactionContext
, when it is also used forcalls
, which are not transactions. MaybeExecutionContext
would be better, orEntrypointExecutionContext
to be more explicit.The text was updated successfully, but these errors were encountered: