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

IPC filenames are inconsistent when --ipcpath and --instance are used together #13798

Open
1 task done
BowTiedDevil opened this issue Jan 14, 2025 · 1 comment
Open
1 task done
Labels
A-cli Related to the reth CLI C-bug An unexpected or incorrect behavior

Comments

@BowTiedDevil
Copy link

BowTiedDevil commented Jan 14, 2025

Describe the bug

If reth or op-reth is launched with an IPC path and an instance value other than the default, the instance number is appended to the IPC filename.

e.g. when specifying --ipcpath=/ipc/op-reth.ipc and --instance=2, the actual IPC filename will be /ipc/op-reth.ipc-2 which is unexpected and not documented behavior of --instance.

The path mangling behavior is reasonable, but inconsistent. It could be improved by appending the "-1" when --instance is provided with the default value of 1. In this way, IPC filenames would be predictably named without needed to treat instance 1 in a special way.

Alternatively, the IPC filenames could be used without any mangling applied, since nodes should use their own data directories and filename collision is unlikely.

I presume that nodes launched without specifying --instance should continue to behave as normal.

Steps to reproduce

Launch with the options described above.

Node logs

# reth launched with --instance=1
Jan 14 10:17:27 dev reth_mainnet[1099553]: 2025-01-14T18:17:27.356217Z  INFO RPC IPC server started path=/ipc/reth.ipc        

# op-reth launched with --instance=2
Jan 14 09:54:42 dev reth_base[1036704]: 2025-01-14T17:54:42.336918Z  INFO RPC IPC server started path=/ipc/op-reth.ipc-2

# reth launched with --instance=3
Jan 14 09:56:57 dev reth_mainnet[1038400]: 2025-01-14T17:56:57.241512Z  INFO RPC IPC server started path=/ipc/reth.ipc-3

Platform(s)

Linux (x86)

Container Type

Other

What version/commit are you on?

reth-optimism-cli Version: 1.1.5
Commit SHA: 3212af2
Build Timestamp: 2025-01-07T10:07:51.565185205Z
Build Features: asm_keccak,jemalloc,optimism
Build Profile: release

reth Version: 1.1.5
Commit SHA: 3212af2
Build Timestamp: 2025-01-07T09:32:44.053190141Z
Build Features: asm_keccak,jemalloc
Build Profile: release

What database version are you on?

Current database version: 2
Local database version: 2

Which chain / network are you on?

reth

mainnet

op-reth

base

What type of node are you running?

Archive (default)

What prune config do you use, if any?

n/a

If you've built Reth from source, provide the full command you used

No response

Code of Conduct

  • I agree to follow the Code of Conduct
@BowTiedDevil BowTiedDevil added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Jan 14, 2025
@Rjected
Copy link
Member

Rjected commented Jan 14, 2025

Hmm, I think the right behavior to implement when both are passed, would be to use ipcpath if specified, only modifying the path based on the instance num if no ipcpath is passed.

--instance is meant for cases like this:

reth node --instance 1
reth node --instance 2
reth node --instance 3

I could see those having /ipc/reth.ipc-1, /ipc/reth.ipc-2, /ipc/reth.ipc-3 respectively

@emhane emhane added A-cli Related to the reth CLI and removed S-needs-triage This issue needs to be labelled labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Related to the reth CLI C-bug An unexpected or incorrect behavior
Projects
Status: Todo
Development

No branches or pull requests

3 participants