Ante handler checks and validates the transaction. After the verification, it checks the balance of the sender for enough fees and deduct fees in case of successful transaction inclusion.
Each block and transaction have a limit for gas usage. A block can contain multiple transactions. But, gas used by all transactions in a block must be less than block gas limit to avoid larger blocks.
Note that each state manipulation on transaction costs gas, including signature verification for the transaction.
Block gas limit
Max block gas limit and bytes per block is passed while setting up app's consensus params: https://github.com/maticnetwork/heimdall/blob/develop/app/app.go#L464-L471
Transaction gas limit
The transaction gas limit is defined in params in
auth module. It can be changed through the Heimdall
Checkpoint TX gas limit
Since block contains multiple transactions and verifies this particular transaction on the Ethereum chain, Merkle proof is required. To avoid extra Merkle proof verification for checkpoint transaction, Heimdall only allows one transaction in the block if the transaction type is
Transaction verification and replay protection
Ante handler handles and verifies signature in incoming transaction: https://github.com/maticnetwork/heimdall/blob/develop/auth/ante.go#L230-L266
Each transaction must include
sequenceNumber to avoid replay attacks. After each successful transaction inclusion, Ante handler increases the sequence number for the TX sender account to avoid duplication (replay) of the previous transactions.