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

[node] Add more info on error logs #187

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

ian-shim
Copy link
Contributor

@ian-shim ian-shim commented Jan 18, 2024

Why are these changes needed?

  • made core.OperatorID and explicit type instead of an alias, and added a helper method to convert to hex string
  • added metadata in node error logs to help debugging

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@ian-shim ian-shim marked this pull request as ready for review January 18, 2024 08:08
@@ -10,7 +10,6 @@ import (

var (
ErrChunkLengthMismatch = errors.New("chunk length mismatch")
ErrInvalidHeader = errors.New("invalid header")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not being used

@@ -9,7 +9,6 @@ import (

var (
ErrChunkLengthMismatch = errors.New("chunk length mismatch")
ErrInvalidHeader = errors.New("invalid header")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not being used

@@ -28,7 +29,11 @@ var (

// Assignment

type OperatorID = [32]byte
Copy link
Contributor Author

Choose a reason for hiding this comment

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

type aliases are convenient, but I think strict types are safer in general (and allow receiver functions)

@@ -114,7 +114,7 @@ func (f *operatorSocketsFilterer) WatchOperatorSocketUpdate(ctx context.Context,
}

sink := make(chan *blsregcoord.ContractBLSRegistryCoordinatorWithIndicesOperatorSocketUpdate)
operatorID := []core.OperatorID{operatorId}
operatorID := [][32]byte{operatorId}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intended given the goal of this pr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah this is a consequence of making core.OperatorID an explicit type - contract bindings aren't aware of core.OperatorID, so needs to be converted to a primitive type

@ian-shim ian-shim merged commit 3a04329 into Layr-Labs:master Jan 22, 2024
4 checks passed
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.

2 participants