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

fix: ensure unused sol deposit channels are closed #5312

Merged
merged 2 commits into from
Oct 7, 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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes included in each Chainflip release will be documented in this file.

## [1.6.7] - 2024-09-25

### Fixes

- Add missing broker fees migration.
- Close expired Solana channels.

## [1.6.6] - 2024-09-24

### Fixes
Expand Down
8 changes: 6 additions & 2 deletions engine/src/witness/sol/sol_deposits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,14 @@ where
.filter_map(move |(deposit_channel, amount)| {
let amount: SolAmount = amount.saturated_into(); // TODO: Change the DeltaBasedIngress to not use the Chains Amount type but
// instead use u256 or u128 or some generic.
let (_, current_total_ingressed) =
let (deposit_details, current_total_ingressed) =
deposit_channels.get(deposit_channel.address()).unwrap();
if amount != current_total_ingressed.amount ||
slot < current_total_ingressed.block_number
slot < current_total_ingressed.block_number ||
// We avoid submitting an extrinsic if the amount is unchanged. However, the delta_based_ingress election won't close a
// channel until at least one ingress submission reaches consensus. To ensure this happens, we submit the amount on the
// first witnessed slot after the deposit channel's close block.
slot >= deposit_details.close_block
{
Some((
*deposit_channel.address(),
Expand Down
Loading