Skip to main content

validate_state_transition_size

Function validate_state_transition_size 

Source
pub fn validate_state_transition_size(
    size_bytes: u64,
    platform_version: &PlatformVersion,
) -> Result<(), StateTransitionMaxSizeExceededError>
Expand description

Checks the serialized length of a state transition against the protocol’s max_state_transition_size: a transition of size_bytes is refused when it is larger (the limit itself passes), with the error Drive reports for one. Drive’s decoders keep their own copy of this check; the drive-abci test should_agree_with_the_client_size_check_at_every_protocol_version keeps the two in step.

DAPI refuses an oversized transition before Drive sees it with an untyped InvalidArgument, so clients that need the typed error (an asset-lock flow switching from a growing InstantSend proof to a fixed-size ChainLock proof) check it with this before sending.