Skip to content

Commit d8a9fe5

Browse files
Integrate WASM, CipherPodLedger module and Enhance DA Layer with Integrity Checks (#6, #24)
- Added support for WASM integration to enable RUST-based contract deployment. - CipherPodLedger module, enabling FHE-based pod settlements in Junction. - Implemented `LogBlobData` and `IntegrityCheck` functions to improve blob integrity in the DA layer. - Resolved bugs in WASM module test cases and added edge-case test coverage. Closes #6, #24
2 parents 9ebf0f2 + 121916a commit d8a9fe5

File tree

311 files changed

+181560
-761
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

311 files changed

+181560
-761
lines changed

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM ubuntu:latest
2+
LABEL authors="deadlium, computerKeeda, Hitisha-G, saatvik333"
3+
4+
ENTRYPOINT ["top", "-b"]

Dockerfile.builder

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# syntax=docker/dockerfile:1
2+
3+
ARG GO_VERSION="1.22"
4+
ARG RUNNER_IMAGE="gcr.io/distroless/static"
5+
6+
# --------------------------------------------------------
7+
# Builder
8+
# --------------------------------------------------------
9+
10+
FROM golang:${GO_VERSION}-alpine3.20 as builder
11+
12+
ARG GIT_VERSION
13+
ARG GIT_COMMIT
14+
ARG BUILD_TAGS
15+
ARG ENABLED_PROPOSALS
16+
17+
ENV GOTOOLCHAIN go1.22.9
18+
19+
RUN apk add --no-cache \
20+
ca-certificates \
21+
build-base \
22+
linux-headers
23+
24+
# Download Go dependencies
25+
WORKDIR /junction
26+
COPY go.mod go.sum ./
27+
RUN --mount=type=cache,target=/root/.cache/go-build \
28+
--mount=type=cache,target=/root/go/pkg/mod \
29+
go mod download
30+
31+
# Cosmwasm - Download correct libwasmvm version
32+
RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm/v2 | cut -d ' ' -f 2) && \
33+
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$(uname -m).a \
34+
-O /lib/libwasmvm_muslc.$(uname -m).a && \
35+
# Verify checksum
36+
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
37+
sha256sum /lib/libwasmvm_muslc.$(uname -m).a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$(uname -m) | cut -d ' ' -f 1)
38+
39+
# Copy the remaining files
40+
COPY . .
41+
42+
# Build junctiond binary
43+
RUN --mount=type=cache,target=/root/.cache/go-build \
44+
--mount=type=cache,target=/root/go/pkg/mod \
45+
go build \
46+
-mod=readonly \
47+
-tags ${BUILD_TAGS} \
48+
-ldflags "-X github.com/cosmos/cosmos-sdk/version.Name="junction" \
49+
-X github.com/cosmos/cosmos-sdk/version.AppName="junctiond" \
50+
-X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \
51+
-X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \
52+
-X github.com/cosmos/cosmos-sdk/version.BuildTags='${BUILD_TAGS}' \
53+
-X github.com/junction-org/junction/app.EnableSpecificProposals=${ENABLED_PROPOSALS} \
54+
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
55+
-trimpath \
56+
-o /junction/build/junctiond \
57+
/junction/cmd/junctiond
58+
59+
# --------------------------------------------------------
60+
# Runner
61+
# --------------------------------------------------------
62+
63+
FROM ${RUNNER_IMAGE}
64+
65+
COPY --from=builder /junction/build/junctiond /bin/junctiond
66+
67+
ENV HOME /junction
68+
WORKDIR $HOME
69+
70+
EXPOSE 26656
71+
EXPOSE 26657
72+
EXPOSE 1317
73+
74+
ENTRYPOINT ["junctiond"]

Makefile

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
# Makefile for building and linting Go project
2+
DOCKER := $(shell which docker)
3+
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
4+
GO_VERSION=1.23
5+
COMMIT := $(shell git log -1 --format='%H')
6+
7+
LEDGER_ENABLED ?= true
8+
9+
build_tags = netgo
10+
ifeq ($(LEDGER_ENABLED),true)
11+
ifeq ($(OS),Windows_NT)
12+
GCCEXE = $(shell where gcc.exe 2> NUL)
13+
ifeq ($(GCCEXE),)
14+
$(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false)
15+
else
16+
build_tags += ledger
17+
endif
18+
else
19+
UNAME_S = $(shell uname -s)
20+
ifeq ($(UNAME_S),OpenBSD)
21+
$(warning OpenBSD detected, disabling ledger support (https://github.com/cosmos/cosmos-sdk/issues/1988))
22+
else
23+
GCC = $(shell command -v gcc 2> /dev/null)
24+
ifeq ($(GCC),)
25+
$(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false)
26+
else
27+
build_tags += ledger
28+
endif
29+
endif
30+
endif
31+
endif
232

33+
ifeq ($(WITH_CLEVELDB),yes)
34+
build_tags += gcc
35+
endif
36+
build_tags += $(BUILD_TAGS)
37+
build_tags := $(strip $(build_tags))
38+
39+
empty = $(whitespace) $(whitespace)
40+
comma := ,
41+
build_tags_comma_sep := $(subst $(empty),$(comma),$(build_tags))
342
# Basic project settings
443
BINARY_NAME=junctiond
544
BUILD_DIR=./build
@@ -44,6 +83,7 @@ default: build
4483
build: go.sum
4584
@echo "Building $(BINARY_NAME) binary..."
4685
$(GO_BUILD) -tags "$(build_tags)" -ldflags '$(ldflags)' -o $(BUILD_DIR)/$(BINARY_NAME) $(SOURCE_DIR)
86+
@shasum -a 256 $(BUILD_DIR)/$(BINARY_NAME) >> $(CHECKSUM_FILE)
4787

4888
# Install the binary
4989
install:
@@ -85,4 +125,22 @@ build-all: go.sum
85125
GOOS=windows GOARCH=amd64 $(GO_BUILD) -tags "$(build_tags)" -ldflags '$(ldflags)' -o $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.exe $(SOURCE_DIR)
86126
@shasum -a 256 $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.exe >> $(CHECKSUM_FILE)
87127

88-
.PHONY: default build install test clean lint print-system build-all
128+
build-static-linux-amd64: go.sum $(BUILD_DIR)/
129+
mkdir -p $(BUILD_DIR)
130+
$(DOCKER) buildx create --name junctionbuilder || true
131+
$(DOCKER) buildx use junctionbuilder
132+
$(DOCKER) buildx build \
133+
--build-arg GO_VERSION=$(GO_VERSION) \
134+
--build-arg GIT_VERSION=$(VERSION) \
135+
--build-arg GIT_COMMIT=$(COMMIT) \
136+
--build-arg BUILD_TAGS=$(build_tags_comma_sep),muslc \
137+
--platform linux/amd64 \
138+
-t junction-amd64 \
139+
--load \
140+
-f Dockerfile.builder .
141+
$(DOCKER) rm -f junctionbinary || true
142+
$(DOCKER) create -ti --name junctionbinary junction-amd64
143+
$(DOCKER) cp junctionbinary:/bin/junctiond $(BUILD_DIR)/junctiond-linux-amd64
144+
$(DOCKER) rm -f junctionbinary
145+
146+
.PHONY: default build install test clean lint print-system build-all build-static-linux-amd64

0 commit comments

Comments
 (0)