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

feat(rpc): chain RPCs #1147

Merged
merged 7 commits into from
Dec 12, 2024
Merged

feat(rpc): chain RPCs #1147

merged 7 commits into from
Dec 12, 2024

Conversation

Yaiba
Copy link
Contributor

@Yaiba Yaiba commented Dec 11, 2024

This resolves #1121

All APIs listed in the issue are implemented under chain rpc namespace.

These APIs are not implemented:

  • /num_unconfirmed_txs, chain.unconfirmed_txs returned the total txs
  • /tx_search, it's more useful for tx subscription, we don't have the needs yet
  • /block_search, it's more useful for block subscription
  • /check_tx
  • /commit, I don't think we have this kind of info

@@ -6,8 +6,7 @@ import (
"time"

"github.com/kwilteam/kwil-db/core/log"
ktypes "github.com/kwilteam/kwil-db/core/types"
"github.com/kwilteam/kwil-db/node/types"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

can be simplify to just use core types

@@ -68,14 +68,6 @@ func (svc *Service) Methods() map[jsonrpc.Method]rpcserver.MethodDef {
}
}

func (svc *Service) Handlers() map[jsonrpc.Method]rpcserver.MethodHandler {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this is not used

@Yaiba Yaiba force-pushed the feat/chain-stat-rpc branch from 4a35406 to e12bf7c Compare December 11, 2024 18:52
@Yaiba Yaiba marked this pull request as ready for review December 11, 2024 18:53
@Yaiba Yaiba requested a review from charithabandi December 11, 2024 19:52
@Yaiba Yaiba force-pushed the feat/chain-stat-rpc branch 2 times, most recently from 17b1807 to f5d3a19 Compare December 11, 2024 21:14
@@ -30,6 +30,8 @@ type ConsensusEngine interface {
blkRequester consensus.BlkRequester, stateResetter consensus.ResetStateBroadcaster, discoveryBroadcaster consensus.DiscoveryReqBroadcaster) error

CheckTx(ctx context.Context, tx *ktypes.Transaction) error

ConsensusParams() *ktypes.ConsensusParams
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is kind awkward, I have to define this on both ConsensusEngine and Node to pass over to chain rpc

Copy link
Member

Choose a reason for hiding this comment

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

On this point, I think we are likely to have block executor provide. OK for now

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, we could have one more interface using BlockProcessor to provide these functions.

@Yaiba
Copy link
Contributor Author

Yaiba commented Dec 11, 2024

need to implement the client as well, don't review/merge yet

@Yaiba
Copy link
Contributor Author

Yaiba commented Dec 11, 2024

OK, I think it's ready to be reviewed

@Yaiba Yaiba force-pushed the feat/chain-stat-rpc branch from f0930ca to 4bbe029 Compare December 12, 2024 16:09
charithabandi
charithabandi previously approved these changes Dec 12, 2024
Copy link
Contributor

@charithabandi charithabandi left a comment

Choose a reason for hiding this comment

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

Glanced through it, LGTM!

@jchappelow
Copy link
Member

@charithabandi resolution for the RecheckTxs issue?

@jchappelow
Copy link
Member

Just update the interface I suppose?

@charithabandi
Copy link
Contributor

yeah, merge conflict issue, we fixed it, @Yaiba pushing the updates

@jchappelow jchappelow merged commit f9c922f into kwilteam:main Dec 12, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Support RPC endpoints for Chain stats
3 participants