code: def fill_transaction_defaults(web3, transaction):
      
      defaults = {}
      for key, default_getter in TRANSACTION_DEFAULTS.items():
          if key not in transaction:
              if callable(default_getter):
                  if web3 is not None:
                      default_val = default_getter(web3, transaction)
                  else:
                      raise ValueError("You must specify %s in the transaction" % key)
              else:
                  default_val = default_getter
              defaults[key] = default_val
      return merge(defaults, transaction)
docs: if web3 is None, fill as much as possible while offline