sei-chain icon indicating copy to clipboard operation
sei-chain copied to clipboard

feat: staking precompile delegation and stakingpool queries

Open kyriediculous opened this issue 1 year ago • 6 comments

Describe your changes and provide context

Testing performed to validate your change

kyriediculous avatar Feb 16 '24 02:02 kyriediculous

@kyriediculous this looks great, do you mind merging?

philipsu522 avatar Feb 26 '24 21:02 philipsu522

@philipsu522 I'm actually working on implementing a more final specification.

See this hackMD doc https://hackmd.io/EcPRzGcPR8OuAxr-48wkRA

My only hurdle at the moment is that the current cosmos-sdk version used by Sei doesn't have the latest protocol buffer messages for staking. So I'll have to use a later version, but this shouldn't be a breaking change.

E.g. the version used in Sei doesn't have all these fields yet in the protobufs: https://github.com/cosmos/cosmos-sdk/blob/a79f932ecf8ef562928fa72989e53ae22e251d7f/proto/cosmos/staking/v1beta1/staking.proto#L239

Hoping to maybe do it this weekend finally ! I didn't have much time last weekend.

kyriediculous avatar Mar 01 '24 11:03 kyriediculous

@philipsu522

I added some more undelegation precompiles and the PR is now feature ready for us at Tenderize.

Happy to add a few more generic functions too (e.g. to fetch Validator).

One caveat is that we did have to upgrade sei-cosmos protobuf messages : https://github.com/sei-protocol/sei-cosmos/compare/evm...kyriediculous:sei-cosmos:evm

kyriediculous avatar Mar 22 '24 13:03 kyriediculous

@philipsu522

I added some more undelegation precompiles and the PR is now feature ready for us at Tenderize.

Happy to add a few more generic functions too (e.g. to fetch Validator).

One caveat is that we did have to upgrade sei-cosmos protobuf messages : sei-protocol/[email protected]:sei-cosmos:evm

hey @kyriediculous awesome, looks good. One nit thing, for https://github.com/sei-protocol/sei-cosmos/compare/evm...kyriediculous:sei-cosmos:evm our base branch is actually seiv2 - do you think you can rebase your changes (or cherry-pick) on that? we can then get it in. I've also asked for a 2nd pair of eyes on the labs side

philipsu522 avatar Mar 26 '24 16:03 philipsu522

@philipsu522 I added some more undelegation precompiles and the PR is now feature ready for us at Tenderize. Happy to add a few more generic functions too (e.g. to fetch Validator). One caveat is that we did have to upgrade sei-cosmos protobuf messages : sei-protocol/[email protected]:sei-cosmos:evm

hey @kyriediculous awesome, looks good. One nit thing, for sei-protocol/[email protected]:sei-cosmos:evm our base branch is actually seiv2 - do you think you can rebase your changes (or cherry-pick) on that? we can then get it in. I've also asked for a 2nd pair of eyes on the labs side

Thanks ! will do.

One change we made is change the return types from Messages from boolean to useful data.

Do these functions properly throw a REVERT op code on the EVM side when the messages return an error ?

Or is this why there was a boolean parameter in the first place, because an error in the message execution doesnt actually lead to a REVERT opcode and the expectation is for callers to handle the boolean and revert if it returns false ?

kyriediculous avatar Mar 27 '24 00:03 kyriediculous

Hi @codchen @philipsu522 @Kbhat1 @kyriediculous , I want to know if there is plan to integrate this? As I am working on liquid staking on Sei EVM this would be a lot of help.

If this is integrated into next releases that would be helpful too.

nikbhintade avatar Jul 15 '24 07:07 nikbhintade