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

Specify the antehandler #2044

Closed
evan-forbes opened this issue Jul 6, 2023 · 1 comment · Fixed by #2352
Closed

Specify the antehandler #2044

evan-forbes opened this issue Jul 6, 2023 · 1 comment · Fixed by #2352
Assignees
Labels
specs directly relevant to the specs

Comments

@evan-forbes
Copy link
Member

Given its importance and slightly weird usage, we should add a spec for our antehandler. We should be sure to include what occurs to failed transactions and how it is used in prepare/processProposal.

@evan-forbes evan-forbes added the specs directly relevant to the specs label Jul 6, 2023
@evan-forbes
Copy link
Member Author

specifically this comment (copied for convenience)

good question! I don't think the ante handlers are really specified sufficiently anywhere, especially our usage of them, so I added #2044

that might involve updating the above! the reasoning behind saying "all remaining transactions types do not have to be valid" were these lines

sdkTx, err := app.txConfig.TxDecoder()(tx)
if err != nil {
// we don't reject the block here because it is not a block validity
// rule that all transactions included in the block data are
// decodable
continue
}

in the past, the rules were that validators could include invalid transactions in the block. It's very reasonable to see this as incorrect now since the most recent fix to use the entire antehandler instead of only incrementing the nonce!

// we need to increment the sequence for every transaction so that
// the signature check below is accurate. this error only gets hit
// if the account in question doens't exist.
sdkCtx, err = handler(sdkCtx, sdkTx, false)
if err != nil {
logInvalidPropBlockError(app.Logger(), req.Header, "failure to incrememnt sequence", err)
return reject()
}

we might want to say something along the lines of "random tx data is permitted, but decodable sdk.Txs must pass all antehandler checks in order for the block to be valid".

@evan-forbes evan-forbes added this to the Mainnet milestone Jul 11, 2023
@rootulp rootulp self-assigned this Aug 18, 2023
rootulp added a commit that referenced this issue Aug 30, 2023
Closes #2044

---------

Co-authored-by: CHAMI Rachid <[email protected]>
Co-authored-by: Evan Forbes <[email protected]>
Co-authored-by: Callum Waters <[email protected]>
Co-authored-by: Abu Sayeed Khan <[email protected]>
mergify bot pushed a commit that referenced this issue Aug 30, 2023
Closes #2044

---------

Co-authored-by: CHAMI Rachid <[email protected]>
Co-authored-by: Evan Forbes <[email protected]>
Co-authored-by: Callum Waters <[email protected]>
Co-authored-by: Abu Sayeed Khan <[email protected]>
(cherry picked from commit 97fc207)

# Conflicts:
#	specs/src/README.md
#	specs/src/SUMMARY.md
#	specs/src/specs/block_validity_rules.md
0xchainlover pushed a commit to celestia-org/celestia-app that referenced this issue Aug 1, 2024
Closes celestiaorg/celestia-app#2044

---------

Co-authored-by: CHAMI Rachid <[email protected]>
Co-authored-by: Evan Forbes <[email protected]>
Co-authored-by: Callum Waters <[email protected]>
Co-authored-by: Abu Sayeed Khan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
specs directly relevant to the specs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants