Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use user-provided fees for internal messages #1050

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions crypto/block/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
{
Expand Down
1 change: 1 addition & 0 deletions crypto/block/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions doc/GlobalVersions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 1 addition & 0 deletions validator/impl/validate-query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
{
Expand Down
Loading