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

Show info about connected peers in the gql api #1524

Merged
merged 17 commits into from
Dec 11, 2023
Merged

Conversation

Voxelot
Copy link
Member

@Voxelot Voxelot commented Dec 1, 2023

closes: #649

Show information about connected peers that may be useful for debugging purposes via the gql api.

Note: in the future it may make sense to protect this API with a special authentication token.

@Voxelot
Copy link
Member Author

Voxelot commented Dec 4, 2023

todo:

  • switch time_since_last_heartbeat to time_of_last_heartbeat
  • throw runtime errors on the peers api if p2p is disabled

@Voxelot Voxelot marked this pull request as ready for review December 9, 2023 01:47
@Voxelot Voxelot requested a review from a team December 9, 2023 01:47
use super::BlockProducerAdapter;
#[async_trait::async_trait]
impl P2pPort for P2PAdapter {
async fn connected_peers(&self) -> anyhow::Result<Vec<PeerId>> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, it seems we don't use it. Do we need it?

xgreenx
xgreenx previously approved these changes Dec 11, 2023
@xgreenx xgreenx enabled auto-merge (squash) December 11, 2023 19:24
@xgreenx xgreenx merged commit 04c443f into master Dec 11, 2023
22 of 24 checks passed
@xgreenx xgreenx deleted the Voxelot/p2p-api-data branch December 11, 2023 19:46
xgreenx pushed a commit that referenced this pull request Dec 11, 2023
Fixes a CI bug introduced in
#1524

The latest gql schema wasn't properly committed to the branch and for
some reason it wasn't caught in CI until pushed to master.

Failing job:

https://github.com/FuelLabs/fuel-core/actions/runs/7172572694/job/19530049697
@xgreenx xgreenx mentioned this pull request Dec 12, 2023
xgreenx added a commit that referenced this pull request Dec 12, 2023
## Version v0.22.0

### Added

- [#1515](#1515): Added
support of `--version` command for `fuel-core-keygen` binary.
- [#1504](#1504): A `Success`
or `Failure` variant of `TransactionStatus` returned by a query now
contains the associated receipts generated by transaction execution.

#### Breaking
- [#1531](#1531): Make
`fuel-core-executor` `no_std` compatible. It affects the `fuel-core`
crate because it uses the `fuel-core-executor` crate. The change is
breaking because of moved types.
- [#1524](#1524): Adds
information about connected peers to the GQL API.

### Changed

- [#1517](#1517): Changed
default gossip heartbeat interval to 500ms.
- [#1520](#1520): Extract
`executor` into `fuel-core-executor` crate.

### Fixed

#### Breaking
- [#1536](#1536): The change
fixes the contracts tables to not touch SMT nodes of foreign contracts.
Before, it was possible to invalidate the SMT from another contract. It
is a breaking change and requires re-calculating the whole state from
the beginning with new SMT roots.

## What's Changed
* Added support of `--version` command for `fuel-core-keygen` binary by
@xgreenx in #1515
* Weekly `cargo update` by @github-actions in
#1518
* feat: Add receipts to transaction status by @bvrooman in
#1504
* chore: Update gossip heartbeat interval by @bvrooman in
#1517
* Weekly `cargo update` by @github-actions in
#1525
* Run beta 4 e2e test each 30 minutes by @xgreenx in
#1528
* Fix broken link. by @lukema95 in
#1526
* Extract executor into fuel-core-executor crate by @Salka1988 in
#1520
* Weekly `cargo update` by @github-actions in
#1534
* Make `fuel-core-executor` `no_std` compatible by @Salka1988 in
#1532
* Fixed contracts tables to touch only own SMT nodes by @xgreenx in
#1536
* Show info about connected peers in the gql api by @Voxelot in
#1524
* fix committed gql schema by @Voxelot in
#1540

## New Contributors
* @lukema95 made their first contribution in
#1526

**Full Changelog**:
v0.21.0...v0.22.0
Voxelot added a commit that referenced this pull request Dec 12, 2023
This PR restructures the changes from #1524 to fix an error that would
block users from calling `client.chain_info()` without having the p2p
feature enabled.

While throwing errors on apis that use disabled features is our current
convention, it would mean that the sdk testing harness would fail when
trying to get the consensus parameters unless it also enabled the p2p
feature flag.

What changed in this PR:

- Information about peers now part of NodeInfo instead of ChainInfo.
This seemed like a more suitable location, as chain info relates more
towards global network settings and state. NodeInfo on the other hand
shows details about the current node instance you've connected to.
- Peers are not returned in the default query for NodeInfo, and instead
use a special query fragment that's used to only return info about
peers. This is beneficial since it will allow users without p2p enabled
to still fetch NodeInfo, and also reduce api bandwidth by only returning
potentially bulky information about peers through a dedicated api
request instead of by default.

*Note: This is a release blocker for 0.22 as it will prevent the sdk
from working properly*
crypto523 added a commit to crypto523/fuel-core that referenced this pull request Oct 7, 2024
Fixes a CI bug introduced in
FuelLabs/fuel-core#1524

The latest gql schema wasn't properly committed to the branch and for
some reason it wasn't caught in CI until pushed to master.

Failing job:

https://github.com/FuelLabs/fuel-core/actions/runs/7172572694/job/19530049697
crypto523 added a commit to crypto523/fuel-core that referenced this pull request Oct 7, 2024
## Version v0.22.0

### Added

- [#1515](FuelLabs/fuel-core#1515): Added
support of `--version` command for `fuel-core-keygen` binary.
- [#1504](FuelLabs/fuel-core#1504): A `Success`
or `Failure` variant of `TransactionStatus` returned by a query now
contains the associated receipts generated by transaction execution.

#### Breaking
- [#1531](FuelLabs/fuel-core#1531): Make
`fuel-core-executor` `no_std` compatible. It affects the `fuel-core`
crate because it uses the `fuel-core-executor` crate. The change is
breaking because of moved types.
- [#1524](FuelLabs/fuel-core#1524): Adds
information about connected peers to the GQL API.

### Changed

- [#1517](FuelLabs/fuel-core#1517): Changed
default gossip heartbeat interval to 500ms.
- [#1520](FuelLabs/fuel-core#1520): Extract
`executor` into `fuel-core-executor` crate.

### Fixed

#### Breaking
- [#1536](FuelLabs/fuel-core#1536): The change
fixes the contracts tables to not touch SMT nodes of foreign contracts.
Before, it was possible to invalidate the SMT from another contract. It
is a breaking change and requires re-calculating the whole state from
the beginning with new SMT roots.

## What's Changed
* Added support of `--version` command for `fuel-core-keygen` binary by
@xgreenx in FuelLabs/fuel-core#1515
* Weekly `cargo update` by @github-actions in
FuelLabs/fuel-core#1518
* feat: Add receipts to transaction status by @bvrooman in
FuelLabs/fuel-core#1504
* chore: Update gossip heartbeat interval by @bvrooman in
FuelLabs/fuel-core#1517
* Weekly `cargo update` by @github-actions in
FuelLabs/fuel-core#1525
* Run beta 4 e2e test each 30 minutes by @xgreenx in
FuelLabs/fuel-core#1528
* Fix broken link. by @lukema95 in
FuelLabs/fuel-core#1526
* Extract executor into fuel-core-executor crate by @Salka1988 in
FuelLabs/fuel-core#1520
* Weekly `cargo update` by @github-actions in
FuelLabs/fuel-core#1534
* Make `fuel-core-executor` `no_std` compatible by @Salka1988 in
FuelLabs/fuel-core#1532
* Fixed contracts tables to touch only own SMT nodes by @xgreenx in
FuelLabs/fuel-core#1536
* Show info about connected peers in the gql api by @Voxelot in
FuelLabs/fuel-core#1524
* fix committed gql schema by @Voxelot in
FuelLabs/fuel-core#1540

## New Contributors
* @lukema95 made their first contribution in
FuelLabs/fuel-core#1526

**Full Changelog**:
FuelLabs/fuel-core@v0.21.0...v0.22.0
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.

Expose P2P network information from the P2P orchestrator
2 participants