Since the last release, we've added additional metrics to different components. Metrics were added to:
Full Changelog: https://github.com/libp2p/go-libp2p/compare/v0.25.1...v0.26.0
Fix some test-utils used by https://github.com/libp2p/go-libp2p-kad-dht
Full Changelog: https://github.com/libp2p/go-libp2p/compare/v0.25.0...v0.25.1
We've started instrumenting the entire stack. In this release, we're adding metrics for:
Our metrics effort is still ongoing, see https://github.com/libp2p/go-libp2p/issues/1356 for progress. We'll add metrics and dashboards for more libp2p components in a future release.
So far, we were using GoGo Protobuf to compile our Protobuf definitions to Go code. However, this library was deprecated in October last year: https://twitter.com/awalterschulze/status/1584553056100057088. We benchmarked serialization and deserialization, and found that it's (only) 20% slower than GoGo. Since the vast majority of go-libp2p's CPU time is spent in code paths other than Protobuf handling, switching to the official compiler seemed like a worthwhile tradeoff.
Before this release, go-libp2p had an option to use OpenSSL bindings for certain cryptographic primitives, mostly to speed up the generation of signatures and their verification. When building go-libp2p using go build
, we'd use the standard library crypto packages. OpenSSL was only used when passing in a build tag: go build -tags openssl
.
Maintaining our own fork of the long unmaintained go-openssl package has proven to place a larger than expected maintenance burden on the libp2p stewards, and when we recently discovered a range of new bugs (this and this and this), we decided to re-evaluate if this code path is really worth it. The results surprised us, it turns out that:
Now the good news is, that if your node is not using an RSA key, it will never create any RSA signatures (it might need to verify them though, when it connects to a node that uses RSA keys). If you're concerned about CPU performance, it's a good idea to avoid RSA keys (the same applies to bandwidth, RSA keys are huge!). Even for nodes using RSA keys, it turns out that generating the signatures is not a significant part of their CPU load, as verified by profiling one of Kubo's bootstrap nodes.
We therefore concluded that it's safe to drop this code path altogether, and thereby reduce our maintenance burden.
LimitVal
which can explicitly specify "use default", "unlimited", "block all", as well as any positive number. The zero value of LimitVal
(the value when you create the object in Go) is "Use default".
ResourceLimits
type which uses LimitVal
instead of ints so it can encode the above for the resources.LimitConfig
to PartialLimitConfig
and uses ResourceLimits
. This along with the marshalling changes means you can now marshal the fact that some resource limit is set to block all.
In general, you can go from a resource config with defaults to a concrete one with .Build()
. e.g. ResourceLimits.Build() => BaseLimit
, PartialLimitConfig.Build() => ConcreteLimitConfig
, LimitVal.Build() => int
. See PR #2000 for more details.
If you're using the defaults for the resource manager, there should be no changes needed.
We've cleaned up our API to consistently use protocol.ID
for libp2p and application protocols. Specifically, this means that the peer store now uses protocol.ID
s, and the host's SetStreamHandler
as well.
Full Changelog: https://github.com/libp2p/go-libp2p/compare/v0.24.2...v0.25.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。