d3769b2fbc
UnsafeStrToBytes is currently not safe for -d=checkptr=2, since when it cast from smaller struct (string) to bigger struct ([]byte). That causes checkptr complains as the casting straddle multiple heap objects. To fix this, we have to get the string header first, then use its fields to construct the slice. New implementation performs the same speed with the old (wrong) one. name old time/op new time/op delta UnsafeStrToBytes-8 25.7ns ± 1% 25.7ns ± 3% ~ (p=0.931 n=10+17) name old alloc/op new alloc/op delta UnsafeStrToBytes-8 7.00B ± 0% 7.00B ± 0% ~ (all equal) name old allocs/op new allocs/op delta UnsafeStrToBytes-8 0.00 0.00 ~ (all equal) While at it, also simplify UnsafeBytesToStr implementation, since when we can pass the slice directly to unsafe.Pointer, instead of getting the slice header first. |
||
---|---|---|
.github | ||
baseapp | ||
client | ||
codec | ||
contrib | ||
cosmovisor | ||
crypto | ||
docs | ||
internal/conv | ||
proto/cosmos | ||
scripts | ||
server | ||
simapp | ||
snapshots | ||
std | ||
store | ||
telemetry | ||
tests | ||
testutil | ||
third_party/proto | ||
types | ||
version | ||
x | ||
.build.sh | ||
.clang-format | ||
.codecov.yml | ||
.deepsource.toml | ||
.dockerignore | ||
.gitattributes | ||
.gitignore | ||
.golangci.yml | ||
.goreleaser.yml | ||
.mergify.yml | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
Dockerfile | ||
LICENSE | ||
Makefile | ||
README.md | ||
SECURITY.md | ||
STABLE_RELEASES.md | ||
buf.yaml | ||
docker-compose.yml | ||
go.mod | ||
go.sum |
README.md
Cosmos SDK
The Cosmos-SDK is a framework for building blockchain applications in Golang.
It is being used to build Gaia
, the first implementation of the Cosmos Hub.
WARNING: The SDK has mostly stabilized, but we are still making some breaking changes.
Note: Requires Go 1.15+
Quick Start
To learn how the SDK works from a high-level perspective, go to the SDK Intro.
If you want to get started quickly and learn how to build on top of the SDK, please follow the SDK Application Tutorial. You can also fork the tutorial's repository to get started building your own Cosmos SDK application.
For more, please go to the Cosmos SDK Docs.
Cosmos Hub Mainnet
The Cosmos Hub application, gaia
, has moved to its own repository. Go there to join the Cosmos Hub mainnet and more.
Interblockchain Communication (IBC)
The IBC module for the SDK has moved to its own repository. Go there to build and integrate with the IBC module.
Starport
If you are starting a new app or a new module you can use Starport to help you get started and speed up development. If you have any questions or find a bug, feel free to open an issue in the repo.
Disambiguation
This Cosmos-SDK project is not related to the React-Cosmos project (yet). Many thanks to Evan Coury and Ovidiu (@skidding) for this Github organization name. As per our agreement, this disambiguation notice will stay here.