Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
- [#1029](https://github.com/crypto-org-chain/cronos/pull/1029) Change config `async-commit` to `async-commit-buffer`, make the channel size configurable.
- [#1034](https://github.com/crypto-org-chain/cronos/pull/1034) Support memiavl snapshot strategy configuration.
- [#1035](https://github.com/crypto-org-chain/cronos/pull/1035) Support caching in memiavl directly, ignore inter-block cache silently.
- [#1050](https://github.com/crypto-org-chain/cronos/pull/1050) nativebyteorder mode will check endianness on startup, binaries are built with nativebyteorder by default.

*April 13, 2023*

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ ifeq (boltdb,$(findstring boltdb,$(COSMOS_BUILD_OPTIONS)))
BUILD_TAGS += boltdb
endif

# nativebyteorder mode will panic on big endian machines
BUILD_TAGS += nativebyteorder

ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS)))
ldflags += -w -s
endif
Expand Down
3 changes: 2 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
, network ? "mainnet" # mainnet|testnet
, rev ? "dirty"
, static ? stdenv.hostPlatform.isStatic
, nativeByteOrder ? true # nativeByteOrder mode will panic on big endian machines
}:
let
version = "v1.0.4";
pname = "cronosd";
tags = [ "ledger" "netgo" network "rocksdb" "grocksdb_no_link" ];
tags = [ "ledger" "netgo" network "rocksdb" "grocksdb_no_link" ] ++ lib.optionals nativeByteOrder [ "nativebyteorder" ];
ldflags = lib.concatStringsSep "\n" ([
"-X github.com/cosmos/cosmos-sdk/version.Name=cronos"
"-X github.com/cosmos/cosmos-sdk/version.AppName=${pname}"
Expand Down
9 changes: 9 additions & 0 deletions memiavl/layout_native.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ import (
"unsafe"
)

func init() {
buf := [2]byte{}
*(*uint16)(unsafe.Pointer(&buf[0])) = uint16(0xABCD)

if buf != [2]byte{0xCD, 0xAB} {
panic("native byte order is not little endian, please build without nativebyteorder")
}
}

type NodeLayout = *nodeLayout

// Nodes is a continuously stored IAVL nodes
Expand Down