You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Block sync is double-calling types.Block.ValidateBasic, which re-hashes every transaction in a block. In a 100 block CPU profile sync on Osmosis, over a period with especially large blocks, we found that this was the cause of some notable overhead. (18 seconds out of 185 seconds over all processes, at least 70s of which were in non-blocking operations) Under normal block sizes, this time is lower but still high/worth speeding up. (4.1 seconds for 100 blocks)
We should not be double verifying this.
Summary
We are double verifying block hashes in block sync by calling this in two different spots: ValidateMsg here, which calls types.BlockFromProto which calls validate basic, and types.BlockFromProto right here
Problem Definition
Speed up block sync
Proposal
Do some mild API or order of operations changes to reuse the types.BlockFromProto result and only compute it once.