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

chore: use babylon params instead of global parameters #151

Merged
merged 19 commits into from
Mar 12, 2025

Conversation

RafilxTenfen
Copy link
Contributor

@RafilxTenfen RafilxTenfen commented Mar 9, 2025

  • for command stakercli daemon stake-from-phase1 use babylon params instead of global parameters
  • for commands stakercli transaction create-phase1-unbonding-transaction and stakercli transaction create-phase1-withdrawal-transaction add the option for the flag "tx-inclusion-height" be optional (load from the btc node if not set)

@RafilxTenfen RafilxTenfen marked this pull request as draft March 9, 2025 17:10
@RafilxTenfen RafilxTenfen changed the title chore: initial data to load all params chore: use babylon global params Mar 9, 2025
@RafilxTenfen RafilxTenfen changed the title chore: use babylon global params chore: use babylon params instead of global parameters Mar 10, 2025
@@ -55,9 +46,9 @@ var checkDaemonHealthCmd = cli.Command{
Usage: "Check if staker daemon is running.",
Flags: []cli.Flag{
cli.StringFlag{
Name: stakingDaemonAddressFlag,
Name: helpers.StakingDaemonAddressFlag,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just moved a few duplicate flags to get from helpers

@@ -138,14 +129,14 @@ var stakeCmd = cli.Command{
var stakeFromPhase1Cmd = cli.Command{
Name: "stake-from-phase1",
ShortName: "stfp1",
Usage: "\nstakercli daemon stake-from-phase1 [fullpath/to/global_parameters.json]" +
Usage: "\nstakercli daemon stake-from-phase1" +
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the expected path of global parameters

Usage: "Inclusion height of the staking transactions. Necessary to chose correct global parameters for transaction",
Required: true,
Required: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inclusion height is not required anymore, it can load from the btc node

…from create-phase1-unbonding-transaction and create-phase1-withdrawal-transaction
StakingParams []BtcStakingParams `json:"staking_params"`
}

type BtcStakingParams struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only params needed to parse the staking tx

@@ -114,3 +116,16 @@ func StkTxV0ParsedWithBlock(

return parsedStakingTx, notifierTx, status, nil
}

func ParseV0StakingTx(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still let the option to validate the tag if it is provided

@RafilxTenfen RafilxTenfen marked this pull request as ready for review March 10, 2025 18:26
Copy link
Collaborator

@KonradStaniec KonradStaniec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general code looks good but imo it can be simplified a bit

@RafilxTenfen RafilxTenfen merged commit 57852f3 into main Mar 12, 2025
9 checks passed
RafilxTenfen added a commit that referenced this pull request Mar 12, 2025
RafilxTenfen added a commit that referenced this pull request Mar 13, 2025
* chore: backport #151

* chore: add back param sendToBabylonFirst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants