Skip to content

Conversation

@kobayurii
Copy link
Member

@kobayurii kobayurii commented Aug 18, 2025

What's Changed

  • Added postgres as a storage for tx_details_storage
  • Changed database schema for state changes to improve performance
  • Added new custom RPC method emulate_tx
  • Fix lake authorization for fastnear data

Supported Nearcore Version

  • nearcore v2.7.0
  • rust v1.86.0

khorolets and others added 7 commits May 29, 2025 11:03
…Details (#402)

* :feat(tx-details-storage): Extract the storage logic into a trait to be able to introduce other storages

* Update tx-indexer to work with the tx-details-storage Storage trait

* Update rpc-server to use tx-details-storage Storage trait

* Rename TxDetailsStorage to ScyllaDbTxDetailsStorage

* Extend tx-details-storage::Storage trait to accept block_height for postgres

* Move the Postgres database interaction from tx-details-storage to database crate, optimize the code according to review suggestions

* Move ScyllaDB interaction from tx-details-storage to database crate, add necessary implementation to keep the code consistent

* tx-indexer can use postgres, read-rpc-server can get transactions from postgres

* Introduce tx_details_storage_provider config to choose between Postgres (default) and ScyllaDb, implement the choice in the tx-indexer and rpc-server configuration

* Move SQL migrations from the code to files

* Update CHANGELOG and READMEs
* fix lake auth

* remove github release for near-state-indexer
* feat(rpc-server): Custom method to emulate transaction

* fmt

* function call Code storage update for transaction emulation

* collect cross call results

* make clippy happy

* tx emulator improvement

* add docstring

* add docs for new custom method

* improvement
…s and updates (#410)

* refactor(database,state-indexer): Introduce compact schema for state_changes that is more efficient to read from

* chore(database, logic-state-indexer): Split database/postgres/state_indexer into files. Remove redundant block_hash from handle_state_changes method in logic-state-indexer

* chore(database, state-indexer): Add additional metrics to monitor how long state indexer writes take time and how many partitions touched

* refactor(database, state-indexer): Add postgresql function to match partition number. Switch CTE to unnest for updates

* refactor(database, state-indexer): Replace numberic(20,0) for block_heights to biging (i64) to speed inserts and updates up

* refactor(database, rpc-server): Update read queries related to states to use i64 instead of BigDecimal

* add migration scripts

* add indexes for new tables

* start state indexer from interaption block

* paginated state optimization

* fix paginated state

* fix query

* fix page_token

---------

Co-authored-by: Yurii Koba <[email protected]>
* update nearcore to 2.7.0

* update readme

* update changelog
* add doc about migration via sxlx

* update readme
@kobayurii kobayurii marked this pull request as ready for review August 18, 2025 07:20
@kobayurii kobayurii requested a review from khorolets August 18, 2025 07:20
@kobayurii kobayurii self-assigned this Aug 18, 2025
@kobayurii kobayurii merged commit b5fe030 into main Aug 18, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants