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

Fixed mint of extra currencies #220

Merged
merged 1 commit into from
Mar 5, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## Version 0.55.98

- Fixed mint of extra currencies. A bug in the validator was caused while minting the second and next currencies. The result was a validation failure.

## Version 0.55.97

- Improved alforithm for ping of bad peers
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build = 'common/build/build.rs'
edition = '2021'
name = 'ton_node'
version = '0.55.97'
version = '0.55.98'

[workspace]
members = [ 'storage' ]
Expand Down Expand Up @@ -86,7 +86,7 @@ tokio = { features = [ 'rt-multi-thread' ], version = '1.5' }
tokio-util = '0.7'
adnl = { features = [ 'client', 'node', 'server' ], git = 'https://github.com/tonlabs/ever-adnl.git', tag = '0.9.23' }
catchain = { path = 'catchain' }
dht = { git = 'https://github.com/tonlabs/ever-dht.git', tag = '0.6.88' }
dht = { git = 'https://github.com/tonlabs/ever-dht.git', tag = '0.6.89' }
lockfree = { git = 'https://github.com/tonlabs/lockfree.git' }
overlay = { git = 'https://github.com/tonlabs/ever-overlay.git', tag = '0.7.20' }
rldp = { git = 'https://github.com/tonlabs/ever-rldp.git', tag = '0.8.16' }
Expand Down
6 changes: 4 additions & 2 deletions src/validator/validate_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1412,13 +1412,15 @@ impl ValidateQuery {
};
to_mint_config.iterate_with_keys(|curr_id: u32, amount| {
let amount2 = base.prev_state_extra.global_balance.get_other(curr_id)?.unwrap_or_default();
if amount >= amount2 {
if amount > amount2 {
let mut delta = amount.clone();
delta.sub(&amount2)?;
log::debug!(target: "validate_query", "({}): currency #{}: existing {}, required {}, to be minted {}",
base.next_block_descr,
curr_id, amount2, amount, delta);
to_mint.set_other_ex(curr_id, &delta)?;
if curr_id != 0 {
to_mint.set_other_ex(curr_id, &delta)?;
}
}
Ok(true)
}).map_err(|err| error!("error scanning extra currencies to be minted : {}", err))?;
Expand Down