forest icon indicating copy to clipboard operation
forest copied to clipboard

Properly set user agent

Open elmattic opened this issue 3 years ago • 2 comments

So node operators know what version people are running.

Right now what's set in forest is rust-libp2p/0.2.0 which is the default value in IdentifyConfig in crate libp2p-identify:

    /// Defaults to `rust-libp2p/<libp2p-identify-version>`.
    pub agent_version: String,

For reference, lotus's user agents look like this:

- Peers using lotus:
--- lotus-1.13.0+mainnet+git.7a55e8e89: 410
--- lotus-1.13.0+mainnet+git.5e3f1a15d.1635672001: 140
--- lotus-1.13.0+mainnet+git.7a55e8e89.dirty: 83
--- lotus-1.13.0+mainnet+git.5e3f1a15d.1635672227: 47
--- lotus-1.12.0+mainnet+git.6d8a6c480: 37
...

We should match this scheme.

elmattic avatar Jan 31 '22 16:01 elmattic

our compile-time version string is already comparable, maybe it can be used?

https://github.com/ChainSafe/forest/blob/main/forest/build.rs#L27

q9f avatar Jan 31 '22 17:01 q9f

our compile-time version string is already comparable, maybe it can be used?

https://github.com/ChainSafe/forest/blob/main/forest/build.rs#L27

Yes we can use similar code than for version. I think that for some scripts, tools to work at PL the user agent strictly have to conform to this syntax: <clientname>-<version>+<network>+<gitrevision>

elmattic avatar Jan 31 '22 17:01 elmattic

Closed by #2790

elmattic avatar Apr 25 '23 21:04 elmattic