Skip to content

Sequence diagram for new txid-specific acceleration data retrieval #76

@Dargon789

Description

@Dargon789

Reviewer's Guide

This PR refactors the frontend sync-assets script into a promise‐based, modular workflow driven by a unified config object, introduces a new txid‐specific accelerator endpoint in the backend and updates the frontend to consume it with improved retry/filter logic, optimizes block indexing and caching via height cutoffs and skipMemoryCache support, raises express body size limits, enhances CI/CD workflows, and applies minor UI and integration fixes.

Sequence diagram for new txid-specific acceleration data retrieval

sequenceDiagram
  participant TrackerComponent
  participant ServicesApiService
  participant BackendAPI
  participant AccelerationRepository

  TrackerComponent->>ServicesApiService: getAccelerationDataForTxid$(txid)
  ServicesApiService->>BackendAPI: GET /accelerator/accelerations/:txid
  BackendAPI->>AccelerationRepository: $getAccelerationInfoForTxid(txid)
  AccelerationRepository-->>BackendAPI: Acceleration data or null
  BackendAPI-->>ServicesApiService: Acceleration data or 404
  ServicesApiService-->>TrackerComponent: Acceleration data or null
  Note over TrackerComponent: Retry logic if no data and tx was accelerated
  TrackerComponent->>TrackerComponent: Update accelerationInfo, setIsAccelerated()
Loading

Class diagram for AccelerationRepository and new method

classDiagram
  class AccelerationRepository {
    +$getAccelerationInfoForTxid(txid: string): Promise<PublicAcceleration | null>
    +$getAccelerationInfo(poolSlug: string | null, height: number | null, interval: string | null): Promise<PublicAcceleration[]>
    ...
  }
Loading

Class diagram for ServicesApiService frontend changes

classDiagram
  class ServicesApiService {
    +getAccelerationDataForTxid$(txid: string): Observable<Acceleration>
    +getAllAccelerationHistory$(params, limit?, findTxid?): Observable<Acceleration[]>
    ...
  }
Loading

Class diagram for TrackerComponent acceleration logic changes

classDiagram
  class TrackerComponent {
    -fetchAcceleration$: Subject<number>
    +accelerationInfo: Acceleration | null
    +setIsAccelerated()
    ...
  }
Loading

Class diagram for TransactionComponent acceleration logic changes

classDiagram
  class TransactionComponent {
    +accelerationInfo: Acceleration | null
    +setIsAccelerated()
    ...
  }
Loading

File-Level Changes

Change Details Files
Rewrite and refactor asset synchronization script into modular async workflow
  • switch to promise‐based fs API and unified ENV config object
  • extract common utilities (httpsRequest, downloadFile, processFileItem, fetchGitHubContents)
  • implement main async flow with dryRun, mempoolCDN and GitHub auth support
frontend/sync-assets.js
Overhaul acceleration data endpoint and frontend logic
  • add $getAccelerationInfoForTxid repository method and new GET /accelerator/accelerations/:txid route
  • introduce getAccelerationDataForTxid$ in services API
  • update transaction and tracker components to conditionally call new endpoint with network check, refined retry/delay and filter null responses
backend/src/repositories/AccelerationRepository.ts
backend/src/api/acceleration/acceleration.routes.ts
frontend/src/app/services/services-api.service.ts
frontend/src/app/components/transaction/transaction.component.ts
frontend/src/app/components/tracker/tracker.component.ts
Optimize block indexing and chain tip handling
  • compute minIndexHeight cutoff from config and skip stale blocks beyond that window
  • enhance orphan and canonical block caching logic
  • add skipMemoryCache parameter to getBlock API and respect it
backend/src/api/chain-tips.ts
backend/src/repositories/BlocksRepository.ts
backend/src/api/blocks.ts
Increase backend request body size limits
  • set express.urlencoded, express.text and express.json limits to 10mb
backend/src/index.ts
Improve CI/CD workflows
  • restrict tagging ‘latest’ to non-prerelease tags in on-tag workflow
  • rename tagging step and bump rust-toolchain version in CI pipeline
.github/workflows/on-tag.yml
.github/workflows/ci.yml
Apply minor UI fixes
  • replace Citadel integration link with Nirvati in about page
  • enforce network === '' check before fetching accelerator data in block components
frontend/src/app/components/about/about.component.html
frontend/src/app/components/block/block-preview.component.ts
frontend/src/app/components/block/block.component.ts

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Originally posted by @sourcery-ai[bot] in #75 (comment)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdependenciesPull requests that update a dependency filedocumentationImprovements or additions to documentationduplicateThis issue or pull request already existsenhancementNew feature or requestgood first issueGood for newcomersinvalidThis doesn't seem rightjavascriptPull requests that update javascript codequestionFurther information is requested

Projects

Status

Backlog

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions