Skip to content

Comments

feat: task pipeline-based architecture#346

Open
effie-ms wants to merge 36 commits intomainfrom
feat-tasks-pipeline
Open

feat: task pipeline-based architecture#346
effie-ms wants to merge 36 commits intomainfrom
feat-tasks-pipeline

Conversation

@effie-ms
Copy link
Contributor

@effie-ms effie-ms commented Jan 29, 2026

Which Jira task is linked to this PR?

https://lifi.atlassian.net/browse/LF-17393

Why was it implemented this way?

executeStep() is refactored: now there is a single flow of tasks, and ecosystem packages implement only ecosystem-specific context and tasks themselves. Shared implementations of tasks are reused from the main SDK package.

Checklist before requesting a review

  • I have performed a self-review and testing of my code.
  • This pull request is focused and addresses a single problem.
  • If this PR modifies the SDK API or adds new features that require documentation, I have updated the documentation in the public-docs repository.

@effie-ms effie-ms self-assigned this Jan 29, 2026
@effie-ms effie-ms added the v4 label Jan 29, 2026
@effie-ms effie-ms marked this pull request as ready for review February 18, 2026 10:28
@effie-ms effie-ms requested a review from chybisov February 18, 2026 10:28
import { getSubstatusMessage } from '../../actionMessages.js'
import type { StatusManager } from '../../StatusManager.js'

const TRANSACTION_HASH_OBSERVERS: Record<string, Promise<StatusResponse>> = {}

Choose a reason for hiding this comment

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

TRANSACTION_HASH_OBSERVERS is a module-level mutable cache of promises that can persist across requests and leak request-specific state. Consider avoiding process-global request-specific caches.

Details

✨ AI Reasoning
​A module-level mutable object was introduced that stores promises for transaction status lookups keyed by txHash. Such a global persists across requests in long-running Node.js processes and can retain request-specific data or promises, causing unintended sharing or stale data across users/requests. This harms isolation between requests and can lead to data leakage or race conditions when different requests interact with the same txHash key.

🔧 How do I fix it?
Avoid storing request-specific data in module-level variables. Use request-scoped variables or explicitly mark shared caches as intentional.

Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the process-global cache for transaction status polling. Now each step execution gets its own cache object (transactionStatusObservers: {}) created in BaseStepExecutor.getBaseContext and passed through the execution context.

waitForTransactionStatus takes transactionStatusObservers to deduplicate polling for the same txHash within that step run. So deduplication is unchanged within a single step execution and there is no shared state across steps or requests, so there’s no cross-request leakage or wrong-step updates.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant