Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Improve chain connector storage #9198

Merged
merged 14 commits into from
Mar 13, 2024

Conversation

ishantiw
Copy link
Contributor

@ishantiw ishantiw commented Feb 16, 2024

What was the problem?

This PR resolves #9195

How was it solved?

  • Improve storage to retrieve by key/val and delete efficiently instead of managing full array
  • Reduce number of RPC calls during new block event
  • Improve cleanup
  • Add tests

How was it tested?

  • Run interop setup
  • Register sidechains on mainchain and mainchain on sidechains.
  • Make cross chain transfers using the scripts as mentioned in the readme
  • Stop mainchain-node-two for more than 1000 blocks (mainchain-node-one generates the blocks) and then start it and see if it syncs properly and starts sending valid CCUs without any errors.

@ishantiw ishantiw self-assigned this Feb 16, 2024
@ishantiw ishantiw force-pushed the 9195-improve-chain-connector-storage branch 2 times, most recently from 662d8ca to 14d041e Compare February 19, 2024 18:06
@ishantiw ishantiw requested review from Incede and Phanco February 20, 2024 14:55
@ishantiw ishantiw marked this pull request as ready for review February 29, 2024 18:50
@ishantiw ishantiw force-pushed the 9195-improve-chain-connector-storage branch from ce0d7dc to b9fbad1 Compare March 5, 2024 14:38
Base automatically changed from 9194-save-inclusion-proof to hotfix/6.0.2 March 6, 2024 11:51
ishantiw added 11 commits March 6, 2024 13:26
- Add config to take keepInclusionProofsForHeights and inclusionProofKeys
- Add DB update to get/set/delete inclusionProofs
- Add handler in new block event to save inclusion proofs
- Add endpoint for chain to get inclusion proofs by height
- Improve storage to retrieve by key/val and delete efficiently instead of managing full array
- Reduce number of RPC calls during new block event
- Improve cleanup
@ishantiw ishantiw force-pushed the 9195-improve-chain-connector-storage branch from b9fbad1 to 56cc560 Compare March 6, 2024 12:26
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

Attention: Patch coverage is 79.24242% with 137 lines in your changes are missing coverage. Please review.

Project coverage is 83.28%. Comparing base (39c521f) to head (228050a).

❗ Current head 228050a differs from pull request most recent head 053a4e0. Consider uploading reports for the commit 053a4e0 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##           hotfix/6.0.2    #9198      +/-   ##
================================================
- Coverage         83.52%   83.28%   -0.24%     
================================================
  Files               606      608       +2     
  Lines             22890    23101     +211     
  Branches           3377     3379       +2     
================================================
+ Hits              19118    19239     +121     
- Misses             3772     3862      +90     
Files Coverage Δ
...ain-connector-plugin/src/chain_connector_plugin.ts 91.42% <100.00%> (+12.41%) ⬆️
...-framework-chain-connector-plugin/src/constants.ts 100.00% <100.00%> (ø)
...sk-framework-chain-connector-plugin/src/schemas.ts 100.00% <100.00%> (ø)
...lisk-framework-chain-connector-plugin/src/utils.ts 40.42% <100.00%> (-39.12%) ⬇️
...n-connector-plugin/src/active_validators_update.ts 93.75% <66.66%> (+13.39%) ⬆️
...ain-connector-plugin/src/certificate_generation.ts 95.65% <94.11%> (-2.31%) ⬇️
...amework-chain-connector-plugin/src/inbox_update.ts 95.65% <90.00%> (-4.35%) ⬇️
...k-framework-chain-connector-plugin/src/endpoint.ts 76.92% <90.47%> (-20.45%) ⬇️
...ramework-chain-connector-plugin/src/ccu_handler.ts 95.00% <95.00%> (ø)
...-chain-connector-plugin/src/block_event_handler.ts 87.64% <87.64%> (ø)
... and 2 more

... and 1 file with indirect coverage changes

@Madhulearn Madhulearn requested review from shuse2 and removed request for Phanco March 11, 2024 08:21
Copy link
Collaborator

@shuse2 shuse2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change in scope is quite big + im not fully understanding how plugin should work, so i might have missed something for the behavior.

Since it's plugin, i would assume as long as transaction is accepted on sidechain <=> mainchain scenario, it is fine

@ishantiw ishantiw enabled auto-merge (squash) March 13, 2024 06:35
@ishantiw ishantiw merged commit 182f93d into hotfix/6.0.2 Mar 13, 2024
9 checks passed
@ishantiw ishantiw deleted the 9195-improve-chain-connector-storage branch March 13, 2024 06:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants