Skip to content

Commit

Permalink
Disable moving funds action trigger for release v2.0.0
Browse files Browse the repository at this point in the history
Here we are introducing a "feature flag" that disables the moving funds
(and moved funds sweep) feature for the release v2.0.0. We are disabling
it as the feature is not yet ready for mainnet release.
  • Loading branch information
lukasz-zimnoch committed Mar 28, 2024
1 parent 0a488cc commit c41edaf
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 29 deletions.
17 changes: 9 additions & 8 deletions pkg/tbtc/coordination.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,15 @@ func (ce *coordinationExecutor) getActionsChecklist(
actions = append(actions, ActionDepositSweep)
}

if windowIndex%frequencyWindows == 0 {
actions = append(actions, ActionMovedFundsSweep)
}

// TODO: Consider increasing frequency for old wallets in the future.
if windowIndex%frequencyWindows == 0 {
actions = append(actions, ActionMovingFunds)
}
// TODO: Disabled for v2.0.0. Uncomment when the feature is ready.
// if windowIndex%frequencyWindows == 0 {
// actions = append(actions, ActionMovedFundsSweep)
// }

// TODO: Disabled for v2.0.0. Uncomment when the feature is ready.
// if windowIndex%frequencyWindows == 0 {
// actions = append(actions, ActionMovingFunds)
// }

// #nosec G404 (insecure random number source (rand))
// Drawing a decision about heartbeat does not require secure randomness.
Expand Down
39 changes: 20 additions & 19 deletions pkg/tbtc/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -873,25 +873,26 @@ func processCoordinationResult(node *node, result *coordinationResult) {
expiryBlock,
)
}
case ActionMovingFunds:
if proposal, ok := result.proposal.(*MovingFundsProposal); ok {
node.handleMovingFundsProposal(
result.wallet,
proposal,
startBlock,
expiryBlock,
)
}
// TODO: Uncomment when moving funds support is implemented.
case ActionMovedFundsSweep:
if proposal, ok := result.proposal.(*MovedFundsSweepProposal); ok {
node.handleMovedFundsSweepProposal(
result.wallet,
proposal,
startBlock,
expiryBlock,
)
}
// TODO: Disabled for v2.0.0. Uncomment when the feature is ready.
// case ActionMovingFunds:
// if proposal, ok := result.proposal.(*MovingFundsProposal); ok {
// node.handleMovingFundsProposal(
// result.wallet,
// proposal,
// startBlock,
// expiryBlock,
// )
// }
// TODO: Disabled for v2.0.0. Uncomment when the feature is ready.
// case ActionMovedFundsSweep:
// if proposal, ok := result.proposal.(*MovedFundsSweepProposal); ok {
// node.handleMovedFundsSweepProposal(
// result.wallet,
// proposal,
// startBlock,
// expiryBlock,
// )
// }
default:
logger.Errorf("no handler for coordination result [%s]", result)
}
Expand Down
6 changes: 4 additions & 2 deletions pkg/tbtcpg/tbtcpg.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ func NewProposalGenerator(
NewDepositSweepTask(chain, btcChain),
NewRedemptionTask(chain, btcChain),
NewHeartbeatTask(chain),
NewMovingFundsTask(chain, btcChain),
NewMovedFundsSweepTask(chain, btcChain),
// TODO: Disabled for v2.0.0. Uncomment when the feature is ready.
// NewMovingFundsTask(chain, btcChain),
// TODO: Disabled for v2.0.0. Uncomment when the feature is ready.
// NewMovedFundsSweepTask(chain, btcChain),
}

return &ProposalGenerator{
Expand Down

0 comments on commit c41edaf

Please sign in to comment.