-
Notifications
You must be signed in to change notification settings - Fork 42
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: remove cosmos/relayer
dependency
#429
Conversation
are we going to have our own relayer? |
Not really. Main goal of this task is to make our programs to not depend on libraries which are no longer maintained (in this case |
tbh I would name it
Something like that - https://law.stackexchange.com/questions/59999/can-i-copy-pieces-of-apache-licensed-source-code-if-i-attribute ? (though I am not a license expert)
I think one of the goals of this is to, remove dependency on
Or maybe remove |
Removed it in this PR, it wasn't a big effort, commit |
The package |
|
Yeah, but also like we are constantly getting babylon node code checked and this is basically not a part of it, just a consumer |
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
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!
One question, did you test this branch with some service (like use this version in staker and run e2e tests) to see whether change is really not breaking ?
Also, lets merge this one after - #402
I've tested it with Vigilante e2e tests |
client/babylonclient/codec.go
Outdated
"github.com/cosmos/cosmos-sdk/codec/types" | ||
) | ||
|
||
type Codec struct { |
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.
This seems the same as our EncodingConfig
Can we use that?
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.
sure, nice spot
"go.uber.org/zap" | ||
) | ||
|
||
type Client struct { | ||
*query.QueryClient | ||
|
||
provider *cosmos.CosmosProvider | ||
provider *babylonclient.CosmosProvider |
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.
Can we make this public?
provider *babylonclient.CosmosProvider | |
Provider *babylonclient.CosmosProvider |
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.
Yes we can add a getter func
|
||
// GetAccountNumberSequence returns sequence and account number for the given address. | ||
// It returns an error if the account couldn't be retrieved from the state. | ||
func (cc *CosmosProvider) GetAccountNumberSequence(clientCtx client.Context, addr sdk.AccAddress) (uint64, uint64, 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.
can we make a function that increases the account sequence also in the WalletState
// This method will return once the transaction has entered the mempool. | ||
// In an async goroutine, will wait for the tx to be included in the block unless asyncCtx exits. | ||
// If there is no error broadcasting, the asyncCallback will be called with success/failure of the wait for block inclusion. | ||
func (cc *CosmosProvider) SendMessagesToMempool( |
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.
Can we add another option here to specify the sequence in the msg and if it is specified the PrepareFactory would not load from the account sequence
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.
Hm it's going to be a bit much returning and passing account sequence to build messages, maybe we a separate SendMessagesToMempool?
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.
could be as well ;D
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.
Maybe all this is a bit out of the scope of this PR, comparing what's needed in cov emulator PR?
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.
it could be done in another PR, but just adding the account sequence would help to reduce a lot the code copy in covd
Added a new comments here #429 due to comment in babylonlabs-io/covenant-emulator#98 (comment) |
cosmos/relayer
strangelove-ventures/cometbft-client
Todo:As this is modified code from the relayer, what license if any should we include in the header of those files? I've also modified them (deleted a bunch of stuff, and added more code quality improvements)Is feegrant.go needed, feels like it can be removed and other parts related to itFuture PRs can remove references to strangelove cometbft client, tho we do have to satisfy theCometRPC interface
,ABCIClient interface
etc. (not sure if it's worth the extra effort)Decide on the name of the relayer package, the clients would currently userelayerclient.Whatever
Closes