-
Notifications
You must be signed in to change notification settings - Fork 3
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
bump babylon v18 #102
bump babylon v18 #102
Conversation
KonradStaniec
commented
Dec 5, 2024
- bumps babylon to v18
- fixes incompatibilites
- used parameters based on inclusion block height to build delegations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than linter errors! Minor comments:
babylonclient/babyloncontroller.go
Outdated
var stakingTrackerParams *StakingTrackerResponse | ||
if err := retry.Do(func() error { | ||
trackerParams, err := bc.QueryStakingTrackerByBtcHeight(btcHeight) | ||
if err != nil { | ||
return err | ||
} | ||
stakingTrackerParams = trackerParams | ||
return nil | ||
}, RtyAtt, RtyDel, RtyErr, retry.OnRetry(func(n uint, err error) { | ||
bc.logger.WithFields(logrus.Fields{ | ||
"attempt": n + 1, | ||
"max_attempts": RtyAttNum, | ||
"error": err, | ||
}).Error("Failed to query babylon client for staking tracker params") | ||
})); err != nil { | ||
return nil, err | ||
} | ||
|
||
return stakingTrackerParams, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems can by refactored by a bc.stakingTrackerByBtcHeightWithRetry
if err := retry.Do(func() error { | ||
trackerParams, err := bc.QueryStakingTrackerByBtcHeight(btcHeight) | ||
if err != nil { | ||
return err | ||
} | ||
stakingTrackerParams = trackerParams | ||
return nil | ||
}, RtyAtt, RtyDel, RtyErr, retry.OnRetry(func(n uint, err error) { | ||
bc.logger.WithFields(logrus.Fields{ | ||
"attempt": n + 1, | ||
"max_attempts": RtyAttNum, | ||
"error": err, | ||
}).Error("Failed to query babylon client for staking tracker params") | ||
})); err != nil { | ||
return nil, err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems can by refactored by a bc.stakingTrackerByBtcHeightWithRetry
babylonclient/interface.go
Outdated
Params() (*StakingParams, error) | ||
ParamsByBtcHeight(btcHeight uint32) (*StakingParams, error) | ||
StakingTrackerByBtcHeight(btcHeight uint32) (*StakingTrackerResponse, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this called anywhere?