Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: validate transactions in parallel (no trie) #12654

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

miloserdow
Copy link
Member

In the old flow, validation (including signature checks) happened inside verify_and_charge_transaction(). In the new flow, we first run parallel_validate_transactions() to validate and compute the transaction cost (including signature checks) in parallel. Only after a transaction passes validation do we call verify_and_charge_transaction() with the known cost.

graph TD;
    subgraph Old_Flow
    A[Runtime::apply]
    A-->B[self.process_transactions]
    B-->C[process_transaction]
    C-->D[verify_and_charge_transaction]
    D-->E[validate_transaction incl. signature]
    E-->|Valid|F[charge fees & finalize]
    E-->|Invalid|G[reject tx]
    end

    subgraph New_Flow
    A2[Runtime::apply]
    A2-->H[self.process_transactions]
    H-->|parallel|I[parallel_validate_transactions incl. signature]
    I-->|Valid, get cost|J[process_transaction]
    J-->K[verify_and_charge_transaction]
    K-->L[charge fees & finalize]
    I-->|Invalid|M[reject tx early]
    classDef threaded fill:#3240a8,stroke:#333,stroke-width:2px;
    class I threaded;
    end
Loading

(blue = running in parallel)

Testing

TBD

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.

1 participant