Skip to content

Conversation

@danlaine
Copy link

Why this should be merged

The node ID should never be empty

How this works

Self explanatory

How this was tested

Existing UT

@danlaine danlaine requested a review from darioush as a code owner April 14, 2023 14:47
@danlaine danlaine self-assigned this Apr 14, 2023
func (c *networkClient) Request(ctx context.Context, nodeID ids.NodeID, request []byte) ([]byte, error) {
// TODO danlaine: is it possible for this condition to occur?
if nodeID == ids.EmptyNodeID {
return nil, fmt.Errorf("cannot send request to empty nodeID, nodeID=%s, requestLen=%d", nodeID, len(request))
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a useful check to leave on the exported method, I think.
Even if all current uses are correct it might catch errors in future development.

Not very strongly opinionated, happy to defer to @dboehm-avalabs

@danlaine danlaine merged commit 319f38b into dev Apr 21, 2023
@danlaine danlaine deleted the sync-remove-check-for-impossible-condition branch April 21, 2023 19:55
@patrick-ogrady patrick-ogrady added this to the v1.10.1 milestone Apr 28, 2023
maru-ava pushed a commit that referenced this pull request Nov 20, 2025
Signed-off-by: Jonathan Oppenheimer <147infiniti@gmail.com>
Co-authored-by: Austin Larson <78000745+alarso16@users.noreply.github.com>
maru-ava pushed a commit that referenced this pull request Dec 3, 2025
This doesn't totally complete #1113 since I didn't touch the Proof or
Iterator files. However, this does clarify a lot of the use cases, and
what is valid for concurrent operations.

The best way to review this is open the godocs and reading through it,
commenting on what doesn't seem clear. To reproduce the godocs, run:
```
cd ./ffi
godoc -http=:<PORT_NUM>
```

Please leave nit-picky comments! It would be great if any reader of the
docs would know how to use the code.

Closes #1348, #1413
JonathanOppenheimer pushed a commit that referenced this pull request Dec 3, 2025
* update avalanchego dep branch

* fix upgrades after deactivating latest in context

* use branch commit for ava version

* bump avago

* bump go

* restore format changes

---------

Signed-off-by: Ceyhun Onur <ceyhun.onur@avalabs.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants