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

Skip state independent checks in prepare proposal #3300

Open
rootulp opened this issue Apr 11, 2024 · 6 comments
Open

Skip state independent checks in prepare proposal #3300

rootulp opened this issue Apr 11, 2024 · 6 comments
Labels
ice-box this label is automatically applied to all issues. it is removed after starting work optimization item is improves performance resource usage.

Comments

@rootulp
Copy link
Collaborator

rootulp commented Apr 11, 2024

Context

// TODO: we can remove all state independent checks from the ante handler here such as signature verification
// and only check the state dependent checks like fees and nonces as all these transactions have already
// passed CheckTx.

@rootulp
Copy link
Collaborator Author

rootulp commented Apr 11, 2024

It's not clear to me what the benefits are from doing this. It seems like a small performance improvement that we should only pursue if we have data indicating that:

  • (a) prepare proposal takes too long and
  • (b) the ante handler step in prepare proposal is taking too much time relative to the rest of the operations

@evan-forbes
Copy link
Member

it seems a bit risky to me as well. It's true that we've ran check tx successfully on all of the txs, however it seems like it would be easy to let txs slip through the cracks. For example, aren't we skipping signature verification when we call ReCheckTx? if that's the case, is it possible that a transaction gets included that invaldates the nonce of a tx that makes it to Prepare? What happens if a validator isn't running ReCheckTx?

we can quantify how long this is taking with further tracing and profiling, then re-evaluate.

@cmwaters
Copy link
Contributor

It's not clear to me what the benefits are from doing this. It seems like a small performance improvement that we should only pursue if we have data indicating that:

Yeah I agree that we should benchmark how long these operations take to get a better idea of the relative times. Maybe this is a good first step. We are benchmarking a lot of the network latencies as we're assuming that's were the biggest gains can be made, but it may also be a good idea to benchmark more of the computational work i.e. state execution, square construction, checkTx and the other abci calls as these do end up having significant impact on the total system (imagine waiting 3 seconds to process a block before you can continue to gossip it to peers that haven't seen the block yet).

@evan-forbes
Copy link
Member

evan-forbes commented Apr 17, 2024

adding a plot here from a previous analysis for posterity, when the square size is increased, there are dramatic increases in the amount time required for nodes to process and prepare a proposal block. Worse yet, prepare and process proposal cannot overalp (without pipelining ofc) and are blocking, meaning that any increase in time verifying the data root is doubled.

This plot shows square sizes that are 512x512 ODS (anything greater than 32MB)

method_duration_1-val

@rootulp
Copy link
Collaborator Author

rootulp commented Apr 17, 2024

Cool plot! IMO we need to drill into Prepare/ProcessProposal to see if the ante handler is a bottleneck before we do this issue.

@evan-forbes evan-forbes added optimization item is improves performance resource usage. ice-box this label is automatically applied to all issues. it is removed after starting work and removed needs:priority labels May 6, 2024
@cmwaters
Copy link
Contributor

Would be interested to see how much time the application is also handling CheckTx requests in a height

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ice-box this label is automatically applied to all issues. it is removed after starting work optimization item is improves performance resource usage.
Projects
None yet
Development

No branches or pull requests

3 participants