-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Expose signature of the block, if any in GraphQL #770
Conversation
fuel-core/src/schema/block.rs
Outdated
@@ -79,6 +84,19 @@ impl Block { | |||
&self.header | |||
} | |||
|
|||
async fn signature(&self, ctx: &Context<'_>) -> Option<Signature> { |
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 think we should have something more generic than signature here, as PoS will have multiple signatures etc. Can we reuse the fuel block consensus type instead?
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.
Of course, we can=) I did it as a signature because it is easy to use. The question do we want to bring the complexity now or later=)
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.
After a private discussion, we can add complexity now and add an additional block_producer
method to the Block
.
Added compatibility tests for `fuel-core` and `fuel-client`.
@@ -19,6 +19,7 @@ members = [ | |||
"fuel-tests", | |||
"fuel-txpool", | |||
"xtask", | |||
"version-compatibility", |
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.
@Voxelot wrote in the slack:
Im thinking we should test if client will still work against 0.14.1. Since it's a new field it'd be nice if an older version of the server just ignored the request, but we should double check that this won't suddenly break the SDK etc
So I added tests to verify version compatibility between 0.14.1
and 0.14.2
if let TransactionStatus::Success { block_id, .. } = | ||
transaction_response.unwrap().status | ||
{ | ||
// TODO: We need to decide is that breaking change or not. For now, the test fails, |
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.
If fuel-client
is 0.14.2
but fuel-core
is 0.14.1
the test fails with "Unknown field 'consensus'".
We have 4 variants on how to fix that=)
- Make a breaking change
0.15.0
. - Extract
consensus
fromBlock
into a separate method and on the client side try to fetch that part if it is possible in a separate request. - Do two requests, one with a new version of the block, if it fails, send it with the old version=)
- Add a new method to the
Block
infuel-client
to get theconsensus
field by passingFuelClient
=)
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.
Option 1. would be the cleanest, as fuel-client 0.15.0 would still be compatible with fuel-core 0.14.1.
Previously the producer of the block was a part of the header. But after change it is not. Added exposing of all information required to get it