Skip to content

feat(sequencer, indexer): Use zone-sdk instead of bedrock client #389

Open
pradovic wants to merge 16 commits intomainfrom
pg/zone-sdk-lez
Open

feat(sequencer, indexer): Use zone-sdk instead of bedrock client #389
pradovic wants to merge 16 commits intomainfrom
pg/zone-sdk-lez

Conversation

@pradovic
Copy link
Copy Markdown
Contributor

@pradovic pradovic commented Mar 9, 2026

🎯 Purpose

This PR introduces logos-blockchain zone-sdk to hide some complexity from LEZ node in implementing sequencer and indexer. Mainly the part of working with logos blockchain node and submission and lifecycle of transactions.

⚙️ Approach

Zone-sdk has taken over the role of submission/resubmitting strategy, along with the back-fill and support for checkpoints.

🧪 How to Test

Integration tests and regular tests should pass as before the change.

🔗 Dependencies

No dependencies for now.

🔜 Future Work

  • address todo comments (remove msg_id field from rocksdb)

TO COMPLETE IF APPLICABLE

📋 PR Completion Checklist

Mark only completed items. A complete PR should have all boxes ticked.

  • Complete PR description
  • Implement the core functionality
  • Add/update tests
  • Add/update documentation and inline comments

@pradovic pradovic changed the title Use zone-sdk instead of bedrock client in sequencer and indexer feat(sequencer, indexer): Use zone-sdk instead of bedrock client Mar 9, 2026
@pradovic pradovic marked this pull request as draft March 9, 2026 16:20
@pradovic pradovic self-assigned this Mar 10, 2026
@pradovic pradovic changed the title feat(sequencer, indexer): Use zone-sdk instead of bedrock client feat(sequencer, indexer): Use zone-sdk instead of bedrock client POC Mar 10, 2026
@pradovic

This comment was marked as outdated.

@pradovic pradovic changed the title feat(sequencer, indexer): Use zone-sdk instead of bedrock client POC feat(sequencer, indexer): Use zone-sdk instead of bedrock client Apr 29, 2026
@pradovic pradovic marked this pull request as ready for review April 29, 2026 12:06
@moudyellaz moudyellaz requested a review from Pravdyvy April 29, 2026 12:20
Copy link
Copy Markdown
Collaborator

@Pravdyvy Pravdyvy left a comment

Choose a reason for hiding this comment

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

lgtm

Comment thread Cargo.toml
Comment on lines +123 to +128
logos-blockchain-common-http-client = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "ee281a447d95a951752461ee0a6e88eb4a0f17cf" }
logos-blockchain-key-management-system-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "ee281a447d95a951752461ee0a6e88eb4a0f17cf" }
logos-blockchain-core = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "ee281a447d95a951752461ee0a6e88eb4a0f17cf" }
logos-blockchain-chain-broadcast-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "ee281a447d95a951752461ee0a6e88eb4a0f17cf" }
logos-blockchain-chain-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "ee281a447d95a951752461ee0a6e88eb4a0f17cf" }
logos-blockchain-zone-sdk = { git = "https://github.com/logos-blockchain/logos-blockchain.git", rev = "ee281a447d95a951752461ee0a6e88eb4a0f17cf" }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These libraries don't have some stable readable tag yet? E.g. on stage we use 0.1.2 release, can't we use 0.1.2 tag here?

Copy link
Copy Markdown
Contributor Author

@pradovic pradovic May 1, 2026

Choose a reason for hiding this comment

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

There was some stable tag, but there were also some improvements after it and zone-sdk and release did not really match so I wanted to use the most recent one.

I wanted to re-export crates through sdk so we can unify everything into a single dep as well. I would like to open a separate PR for this and then let's try to pin some sensible release. I think I can do that in the next week or two.

Does that makes sense?


logos-blockchain-node-0:
image: ghcr.io/logos-blockchain/logos-blockchain@sha256:c5243681b353278cabb562a176f0a5cfbefc2056f18cebc47fe0e3720c29fb12
image: ghcr.io/logos-blockchain/logos-blockchain@sha256:9f1829dea335c56f6ff68ae37ea872ed5313b96b69e8ffe143c02b7217de85fc
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we also pin 0.1.2 here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as the above, I will need to make the docker setup with work with the tag as well.

Comment on lines -6 to -9
"backoff": {
"start_delay": "100ms",
"max_retries": 5
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hmm, interesting, why? Shouldn't client be able to configure retry strategy?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, I will add configurable params to zone-sdk and then later open a specific PR for this as well.

Comment thread sequencer/service/Cargo.toml
Comment thread sequencer/service/src/lib.rs
Comment thread sequencer/core/src/lib.rs Outdated
Comment on lines 29 to 32
// Kept as a thin client lib for callers that want to query the indexer
// directly (e.g. integration tests). The sequencer no longer depends on the
// indexer at runtime — finalization comes from zone-sdk events.
pub mod indexer_client;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think you can safely remove it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Still used in integration tests. I have simplified it and left it only in tests.


/// Mark every pending block with `block_id <= last_finalized` as finalized.
/// Idempotent — already-finalized blocks are skipped.
pub fn clean_pending_blocks_up_to(&self, last_finalized: u64) -> DbResult<()> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
pub fn clean_pending_blocks_up_to(&self, last_finalized: u64) -> DbResult<()> {
pub fn clean_pending_blocks_up_to(&self, last_finalized: BlockId) -> DbResult<()> {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Rest of the storage module uses u64 directly so I used it for consistency. I think I would need to add the dep to nssa_core in order to use it. Maybe it is better to do it in a separate PR for all calls then?

Comment thread indexer/core/src/lib.rs
Copy link
Copy Markdown
Collaborator

@Arjentix Arjentix left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

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