Skip to content

perf(dapi): fetch only specific unconfirmed transaction instead of entire mempool #3775

Description

@QuantumExplorer

Summary

Originally proposed in #2552 (closed in favor of this issue).

When a state transition broadcast fails, DAPI checks the mempool to provide a detailed error. Currently it fetches the entire mempool to confirm the transaction is present, which is unnecessarily expensive.

Proposed change

  • Fetch a specific unconfirmed transaction instead of the entire mempool when detecting duplicate transactions during a state transition broadcast.

Affected areas

  • packages/dapi/lib/grpcServer/handlers/platform/broadcastStateTransitionHandlerFactory.js
  • packages/dapi/test/unit/grpcServer/handlers/platform/broadcastStateTransitionHandlerFactory.spec.js

Notes

The original PR (#2552) targeted v2.1-dev and also bumped the tenderdash Docker image version in dashmate config (plus a config migration). When revisiting this, retarget to the current development branch and re-evaluate whether the tenderdash bump is still needed.

Closed PR for reference: #2552

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions