-
Notifications
You must be signed in to change notification settings - Fork 214
Starknet 0.14.0 #2949
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
Draft
EgeCaner
wants to merge
25
commits into
main
Choose a base branch
from
0.14.0-beta
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Starknet 0.14.0 #2949
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* SubmittedTransactionCache: implementation and test * Added SubmittedTransactionsCache parameters to Node.Config * Integrate cache into RPC * Added test cases for RECEIVED status * Fix linter warning * Update rpc/rpccore/submitted_transaction_cache_test.go Increase readability by storing txhashes and reusing them later rather than rescontructing hashes again Co-authored-by: Rian Hughes <[email protected]> Signed-off-by: Ege Caner <[email protected]> * Update rpc/rpccore/submitted_transaction_cache_test.go Increase readability by introducing `firstTxnHash` variable rather than using felt.Zero Co-authored-by: Rian Hughes <[email protected]> Signed-off-by: Ege Caner <[email protected]> * AddTransaction: return result as nil when err not nil * SubmittedTransactionsCache: Remove function added * rpcv6 and remove from cache on gw success response and adaptTransaction function introduced to reduce cyclomatic complexity * rpc v7, v8: remove from cache on gw success reponse * removed duplicated test on submitted txn cache test * extract txn cache tests in to its own test * txn cache: passing by reference rather than value * SubmittedTransactionsCache: Doc --------- Signed-off-by: Ege Caner <[email protected]> Co-authored-by: Rian Hughes <[email protected]>
* Gateway: URL split * go back to previous urls except 'sepolia-integration'
* bump blockifier version * Blockifier VersionedConstants: use function from blockifier to read constants from file and update files 'versioned_constants/' to be compatible with new version * Use Tip field * Set 'strict_nonce_check' field to 'true' and 'TransactionContext.block_context' field from 'BlockContext' to 'Arc<BlockContext>' * Address linter suggestion * Updated minimum requried rust version in README and MAKEFILE * use short name for 'Tip' --------- Co-authored-by: Rodrigo <[email protected]>
* blockifier version bumped to release candidate * blockifier versioned constants updated
* use txhash from gateway response in cache * rpcv6 add_transaction use txHash from gateway response inserting to cache * update urls * Update validator_test tx commitments, blockhash uses post0_13_4 * SubmittedTransactionsCache test uses mockGateway instead of test gateway * remove omitted field from test gwResponse
* rpcv9 init * add rpcv9 tx validation to validator * silence linter duplicate warning * bump spec version * use mock gateway instead of gw test client rpcv9:submitted_txn_cache_test
* starknet PreConfirmedBlock type * core pre_confirmed_block * pre_confirmed block sn2core adapter * extract starknet state diff into its own type * preconfirmed adapter comment * Feeder: get_pre_confirmed_block * Sync: pre_confirmed_block polling * Comply with Reader interface * CandidateTxs map to list * Add new version * sync.PendingData type * use PendingData in sync and switching from polling pending to preconfirmed * Sequencer empty PendingData impl, and generate sync mock * update test with PendingData * Update sync test to compare against pendingData * PreConfirmed block return number * Allow rpcv9 BlockHeader to omit parent hash, since PreConfirmed block does not have one * Preconfirmed block does not return BlockStatus * RPC < 9 should use latestBlock when pendingID, custom pending state accessor that return latest block if node is fetching preconfirmed block * Remove PreconfirmedStateReader/Writer reuse PendingStateReader/Writer * Pending and PendingData types moved from 'sync' to 'core' * Move rpc pending data wrappers to own file * Use PendingDataInterface to access pendind data * update tests * move Pending back to sync * remove invalid return * New starknet finality statuses * Only keep FINALITY_STATUSES in spec * New Tx statuses and unknown execution status * pending data wrapper for rpcv9 to serve pending block till 0.14.0 * Preconfirmed block sn2core adapter test * Sync TestPendingData for preconfirmed block * PendingDataWrapper test * add get_preconfirmed_block to test feeder * Add post 0.14.0 behaviour test for some endpoints for RPC v < 9 * remove blockchain.pendingBlockFn for favoring pendingBlockFn of RPCs * linter errors * PreConfirmedBlock RPCv9 integration draft * add methods where we need to support pre_confirmed, block to RPCv9 * TransactionByHash: query candidate txs * TestTranasctionByHash from pre_confirmed block * Add test for class related methods and blockTransactionCount * expose json-rpc server v9 * PendingState RPC wrappers for RPC version < 9 * remove redundant functions * Feeder PreConfirmedBlock test * Bring pending subscription back to rpcv9 to serve before 0.14.0 * RPCv9 if tx is pending block use 'ACCEPTED_ON_L2', if in preconfirmed block use 'PRE_CONFIRMED' finality status' * fix tests * BlockWithReceitps support pending block finality RPCv9 * remove test block data and mock the header * adjust comments * Update polling messages * sync store empty pending/pre_confirmed block based on head blockVer * revert default rpc path to v8 * fix linter long line * Events indexing rather than append * reference receivers * block, class, state_update receive by reference * NewPreConfirmed, NewPending and AsPendingData return value types * StateUpdate: indexing instead of append, return by value * For RPCv9 rename 'EventsArg' to 'EventArgs' * RPCv9 returns 'EventsChunk' as value * subscription adjust error message for pre_confirmed * Susbcription: use bool as value and refactor long lines * RPCv9 TransactionStatus return value type * remove unused linter directives * comment for 'TxnFinalityStatus' iota +4 * refactor TestAdaptPreConfirmed, gocyclo * refactor: feeder newTestServer * add validator to jsonrpcServerV09 * sync pending in single goroutine * add TODO comment
Blockifier, convert l2 gas to l1 gas when NoL2Gas GasVectorComputationMode and use overidden values in response
* getMessageStatus return ExecutionStatus * Add unknown execution status
* rpcv9 estimateFee only return FRI, estimateMessageFee only return WEI * linter fix
Introduce new config param PreConfirmedPollInterval
* L1Handler Tx Trace is not REVERTIBLE_FUNCTION_INVOCATION * L1Handler traces return revert reason * RPC version < 9 returns dummy L1_Handler trace for reverted trace * update comments * fix test * use ExecuteInvocation.FunctionInvocation == nil as reverted flag * Add test for reverted L1Handler trace * add AdaptVMTransaction L1Handler reverted for rpc < 9
* InvalidTransactionNonce error returns data * fix linter * New Gw errors * Test case for errors * add test for InvalidTransactionNonce as ValidationFailure * gatewayError.CompilationFailed returns data starting from rpcv8
Minimum supported Rust version is |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2949 +/- ##
==========================================
+ Coverage 72.19% 72.96% +0.77%
==========================================
Files 262 284 +22
Lines 28368 32499 +4131
==========================================
+ Hits 20479 23713 +3234
- Misses 6496 7230 +734
- Partials 1393 1556 +163 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* Getter for TransactionStateDiffs * special handling for preconfirmed block on single tx trace * extract preconfirmed trace into own function * test for sync.PendingStateBeforeIndex
…ed to [0,latest] (#2963) bound event query range to [0, latest] when block numbers out of upper bound
* Return exhausted iter, instead of raising error when from block > to block * add test
* blockifier feature node_api * trace return inner execution resources l1_gas and l2_gas
…for latest (#2965) * Pending Data never nil * tests * remove unused error * remove prints
* rpcv9 handling for rejeceted historical txs * test for rejected status on RPCv9
…m rpcv7 (#2971) * add failure reason for rejected tx * remove revert reason from rpcv7 * test for failure reason * add rpc test for REJECTED txn status * omit if failure reason not present instead of error
* refactor: improve UnmarshalJSON method for BlockID across multiple RPC versions * Replace string comparison with JSON unmarshalling for block tags. * Add error handling for unknown block tags in UnmarshalJSON. * Update logic for handling "latest" and "pending" tags in rpc/v6, rpc/v7, rpc/v8, and rpc/v9. * feat: add starknet_getNonce method to rpcv9 and update handler * Introduced the starknet_getNonce method in rpcv9 with appropriate parameters. * Updated the handler for starknet_getNonce to use the new rpcv9 handler. * test: add unit tests for nonce retrieval in rpcv9 * fix: update nonce API documentation link in rpcv9 --------- Co-authored-by: thiagodeev <[email protected]>
pending data wrappers: add block number to pending block
* always provide pending state * add test for pendig data wrapper
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose of this PR is to see the whole changes regarding version 0.14.0 and RPCv9 anb this PR will be divided in multiple small PRs to facilitate the review process.
Initial plan is to divide this into following PRs, I will attach link to PRs as I create them.
Cache for submitted transactions - PR
RECEIVED
status, we will serveRECEIVED
status from cacheGateway URL split "Two distinct URLs for GW and FGW" - PR
feeder.{chain_name}.starknet.io/feeder_gateway
{chain_name}.starknet.io/gateway
Preconfirmed block type - PR
Polling logic without RPCv9 -PR
RPCv9 init - since rpc/v9 package will contain many duplicate code from previous rpcs this PR will be just duplicate of rpcv8 adjusted as a base for rpcv9 - PR
RPCv9 related changes
starknet_getMessageStatus
response includesExecutionStatus
in RPCv9 - PRWEI
for message fee estimationFRI
forstarknet_estimateFee
REVERTIBLE_FUNCTION_INVOCATION
- PR