<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def estimate_gas( self, transaction: BaseOrSpoofTransaction, at_header: BlockHeader=None) -> int: """ Returns an estimation of the amount of gas the given transaction will use if executed on top of the block specified by the given header. """

        if at_header is None:
            at_header = self.get_canonical_head()
        with self.get_vm(at_header).state_in_temp_block() as state:
            return self.gas_estimator(state, transaction)