-
Notifications
You must be signed in to change notification settings - Fork 67
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): new endpoint for validation status #1129
base: srene/1109-state-update-validation
Are you sure you want to change the base?
feat(rpc): new endpoint for validation status #1129
Conversation
@@ -817,6 +821,24 @@ func (c *Client) CheckTx(ctx context.Context, tx tmtypes.Tx) (*ctypes.ResultChec | |||
return &ctypes.ResultCheckTx{ResponseCheckTx: *res}, nil | |||
} | |||
|
|||
// BlockValidated returns the settlement validation status for a specific height: 0: Not validated, 1: Validated from P2P, 2: Validated from settlement, -1: node is still syncing. |
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.
should probably an enum vs hardcoded
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.
done
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.
I'm not exactly sure in what context this is used, but might it be desirable for the caller to also pass the header hash to check that the block the caller refers to is the same one the node is referring to?
To stop the caller and the callee confusing two different blocks with the same height
Basically the caller wants to know he has the same block the verifier has? or not?
rpc/client/client.go
Outdated
@@ -53,6 +61,10 @@ type Client struct { | |||
genChunks []string | |||
} | |||
|
|||
type ResultBlockValidated struct { | |||
Result int |
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.
why not use the custom type here?
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.
done
rpc/json/service.go
Outdated
@@ -193,6 +194,7 @@ func (s *service) NetInfo(req *http.Request, args *netInfoArgs) (*ctypes.ResultN | |||
} | |||
|
|||
func (s *service) BlockchainInfo(req *http.Request, args *blockchainInfoArgs) (*ctypes.ResultBlockchainInfo, error) { | |||
fmt.Println(args) |
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.
remove
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.
done
that is a good point but i dont think that the software that requires this rpc has the block itself with the hash, just the height. |
@@ -817,6 +829,24 @@ func (c *Client) CheckTx(ctx context.Context, tx tmtypes.Tx) (*ctypes.ResultChec | |||
return &ctypes.ResultCheckTx{ResponseCheckTx: *res}, nil | |||
} | |||
|
|||
// BlockValidated returns the settlement validation status for a specific height: 0: Not validated, 1: Validated from P2P, 2: Validated from settlement, -1: node is still syncing. | |||
func (c *Client) BlockValidated(ctx context.Context, height *int64) (*ResultBlockValidated, 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.
why is height a pointer?
d845738
to
b40009f
Compare
PR Standards
Opening a pull request should be able to meet the following requirements
--
PR naming convention: https://hackmd.io/@nZpxHZ0CT7O5ngTp0TP9mg/HJP_jrm7A
Close #1128
<-- Briefly describe the content of this pull request -->
For Author:
godoc
commentsFor Reviewer:
After reviewer approval: