ChainSafe / ChainSafe/gossamer

Implement `NetworkPeers.ReportPeer` on translation shim type

Open
#4,799 0 comments 0 reactions 0 assignees View on GitHub
T-implementation
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

## Issue summary

- We currently have the ability to report peers using `peerset.Handler.ReportPeer` ([code](https://github.com/ChainSafe/gossamer/blob/3729f32087e3fe4ebd0be35306a98bae97a0b022/dot/peerset/handler.go#L79)).
- In trnanslation shim type #4798 include reference to `peerset.Handler`.
- Implement `ReportPeer` by translating any param types to call `peerset.Handler.ReportPeer`.

## Implementation details

- translate `network.ReputationChange` to `peerset.ReputationChange`
- translate `peerid.PeerID` to `peer.ID`.
- call `peerset.Handler.ReportPeer`
- unit tests

## Other information and links

-

## Acceptance criteria

[] ReportPeer should adjust peer reputation of given peer
[] 70% coverage for `ReportPeer` function.

Contributor guide

Open the contributing guide

Research direction

Start by locating the translation shim type from issue #4798 and read dot/peerset/handler.go around peerset.Handler.ReportPeer. Trace the network.ReputationChange and peerid.PeerID types, then add unit tests covering the ReportPeer delegation and reputation adjustment. Done means the shim calls peerset.Handler.ReportPeer with translated parameters and meets the stated coverage target.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.