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

rpc: avoid use of cgo by hard-coding maxPathSize #42

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

alienc0der
Copy link
Contributor

@georgezgeorgez georgezgeorgez self-requested a review March 11, 2024 03:30
@MoonBaZZe MoonBaZZe self-requested a review March 11, 2024 10:00
Copy link
Collaborator

@MoonBaZZe MoonBaZZe left a comment

Choose a reason for hiding this comment

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

seems clean

@sumamu sumamu self-requested a review March 11, 2024 16:13
@sumamu
Copy link
Collaborator

sumamu commented Mar 11, 2024

Has anyone resynced from scratch using this PR? It shouldn't affect syncing, but I'm going to do it anyway.

if len(endpoint) > int(max_path_size) {
log.Warn(fmt.Sprintf("The ipc endpoint is longer than %d characters. ", max_path_size),
// account for null-terminator too
if len(endpoint)+1 > maxPathSize {
Copy link
Collaborator

@sumamu sumamu Mar 11, 2024

Choose a reason for hiding this comment

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

Why did you replace it with len(endpoint)+1? The value of maxPathSize stayed the same (108).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Check the comment above this line

Copy link
Collaborator

Choose a reason for hiding this comment

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

I have not tested this but can if you think it will be helpful.

@0x3639 0x3639 requested review from MoonBaZZe and sumamu and removed request for MoonBaZZe March 11, 2024 17:30
const (
// On Linux, sun_path is 108 bytes in size
// see http://man7.org/linux/man-pages/man7/unix.7.html
maxPathSize = int(108)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why int(108) and not just 108?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@sumamu did you resolve this question?

@0x3639
Copy link
Collaborator

0x3639 commented Mar 21, 2024

These changes are consistent with this discussion here: ethereum/go-ethereum#27447 (comment)

@0x3639 0x3639 self-requested a review March 25, 2024 10:23
@MoonBaZZe MoonBaZZe merged commit 429e853 into zenon-network:master Mar 26, 2024
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.

4 participants