mirror of
				https://github.com/ton-blockchain/ton
				synced 2025-03-09 15:40:10 +00:00 
			
		
		
		
	Don't use user-provided fees for internal messages (#1050)
This commit is contained in:
		
							parent
							
								
									d46261c110
								
							
						
					
					
						commit
						c54f095c1b
					
				
					 4 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -2392,8 +2392,12 @@ int Transaction::try_action_send_msg(const vm::CellSlice& cs0, ActionPhase& ap,
 | 
			
		|||
    if (!tlb::csr_unpack(msg.info, info) || !block::tlb::t_CurrencyCollection.validate_csr(info.value)) {
 | 
			
		||||
      return -1;
 | 
			
		||||
    }
 | 
			
		||||
    fwd_fee = block::tlb::t_Grams.as_integer(info.fwd_fee);
 | 
			
		||||
    ihr_fee = block::tlb::t_Grams.as_integer(info.ihr_fee);
 | 
			
		||||
    if (cfg.disable_custom_fess) {
 | 
			
		||||
      fwd_fee = ihr_fee = td::zero_refint();
 | 
			
		||||
    } else {
 | 
			
		||||
      fwd_fee = block::tlb::t_Grams.as_integer(info.fwd_fee);
 | 
			
		||||
      ihr_fee = block::tlb::t_Grams.as_integer(info.ihr_fee);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  // set created_at and created_lt to correct values
 | 
			
		||||
  info.created_at = now;
 | 
			
		||||
| 
						 | 
				
			
			@ -3755,6 +3759,7 @@ td::Status FetchConfigParams::fetch_config_params(
 | 
			
		|||
    action_phase_cfg->action_fine_enabled = config.get_global_version() >= 4;
 | 
			
		||||
    action_phase_cfg->bounce_on_fail_enabled = config.get_global_version() >= 4;
 | 
			
		||||
    action_phase_cfg->message_skip_enabled = config.get_global_version() >= 8;
 | 
			
		||||
    action_phase_cfg->disable_custom_fess = config.get_global_version() >= 8;
 | 
			
		||||
    action_phase_cfg->mc_blackhole_addr = config.get_burning_config().blackhole_addr;
 | 
			
		||||
  }
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -168,6 +168,7 @@ struct ActionPhaseConfig {
 | 
			
		|||
  bool action_fine_enabled{false};
 | 
			
		||||
  bool bounce_on_fail_enabled{false};
 | 
			
		||||
  bool message_skip_enabled{false};
 | 
			
		||||
  bool disable_custom_fess{false};
 | 
			
		||||
  td::optional<td::Bits256> mc_blackhole_addr;
 | 
			
		||||
  const MsgPrices& fetch_msg_prices(bool is_masterchain) const {
 | 
			
		||||
    return is_masterchain ? fwd_mc : fwd_std;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -109,3 +109,4 @@ Operations for working with Merkle proofs, where cells can have non-zero level a
 | 
			
		|||
- Slightly change random seed generation to fix mix of `addr_rewrite` and `addr`.
 | 
			
		||||
- Fill in `skipped_actions` for both invalid and valid messages with `IGNORE_ERROR` mode that can't be sent.
 | 
			
		||||
- Allow unfreeze through external messages.
 | 
			
		||||
- Don't use user-provided `fwd_fee` and `ihr_fee` for internal messages.
 | 
			
		||||
| 
						 | 
				
			
			@ -995,6 +995,7 @@ bool ValidateQuery::fetch_config_params() {
 | 
			
		|||
    action_phase_cfg_.action_fine_enabled = config_->get_global_version() >= 4;
 | 
			
		||||
    action_phase_cfg_.bounce_on_fail_enabled = config_->get_global_version() >= 4;
 | 
			
		||||
    action_phase_cfg_.message_skip_enabled = config_->get_global_version() >= 8;
 | 
			
		||||
    action_phase_cfg_.disable_custom_fess = config_->get_global_version() >= 8;
 | 
			
		||||
    action_phase_cfg_.mc_blackhole_addr = config_->get_burning_config().blackhole_addr;
 | 
			
		||||
  }
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue