fc2eedfc66
add offline ecash library minor changes in coconut benchmarks add ecash smart contract change contract traits from coconut to ecash first wave of andrew's suggestion first wave of andrew's suggestion second wave of andrew's suggestion for ecash lib andrew's suggestion for ecash contract licensing commit safety comments for most unwraps more unwrap handling change chrono crate for time latest cargo lock error revamp small visibility fix small fix remove indexedmap from contract + some tweaks add cw2 version in ecash contract remove envryption key from contract change types from coconut to ecash types adapt api model for credential issuance adapt issued credential storage on API add signatures cache on API change API routes for new blind signing modify issued_credential table add issuance logic client-side credential and signature storage client side utils for credential issuance first wave of fix some of andrew's suggestions remove encryption key from deposit freepass issuance client side freepass issuance API side andrew's suggested fixes other suggested fix adapt change from PR below allow offline verification flag credential spending models credential spending models for client credential preperation for the client credential preperation for the client credential storage for spending on client bloom filter for API spent credential storage on validators API route for spending online and offline ecash API routes in the client lib credential storage on gateway ecash verifier to replace coconut verifier accept credentials on gateway bandwidth expiration for gateways client ask for more bandwidth if it runs out credential import adapt nym validator rewarder and sdk fix tests api tests and add constants cargo fmt and lock and small test fix cargo fmt and lock and small test fix cargo lock move stuff where they belong in ecash and static parameters move some constants, error handling and phase out time crate error revamp part 2 secret key by ref instead of clone change l in wallet and v visibility rework payinfo rework monster tuples fix expiration date signature cloning minor fixes final bits and bobs fixes final bits and bobs fixes rename l accessor to tickets_spent wave of fixes second wave of fixes change hash domain value removed benchmark flag remove useless stringification in storage nuke Bandwidth voucher change timestamps to offsetdatetime key name change post-rebase fixes update nym-connect 'time' dep due to broken semver upload ecash contract to the build server make wasm zknym-lib compile but it won't work properly just yet make wasm zknym-lib compile but it won't work properly just yet fix typo in ecash contract deps make sure to use 0.1.0 sphinx packet optimise pairings in 'check_vk_pairing' derive serde for ecash types simplified g1 tuple byte conversion further optimise the pairing unified signature type + renamed nym-api coconut module to ecash using bincode serialiser for more complex binary types using multimiller loop instead of rayon for verifying coin indices signatures batching signature verification wherever possible feature-locked rayon clippy refactor ecash contract a bit + introduce deposit storage reworked find_proposal_id various minor fixed add offline_zk_nyms to nym-node everywhere add missing #query change test value to fit new serialization optimised deposits storage removed duplicate decompression code using deposit_id instead of transaction hash removed freepasses split up ecash handling unified shared state fixed deposit_id parsing log recovered deposit id removed online verification add detailed build info to ecash contract fixed deserialisation of deposit amount received from nyxd queries changed deposit to only persist attached pubkey first iteration of split of verification and redemption basic tool for setting up new network expanded the tool with the option to bypass DKG rename + init network without DKG setting up locally running apis ecash key migration more local functionalities wip fixing sql schemas gateway immediately submitting redemption proposal and getting it passed if valid most of the gateway logic for split redemption with error recovery fixed gateway not persisting ecash signers simplify creation of compatible client create properly serialised ecash key from the beginning rebuild missing tickets and proposals on startup stop ticket issuance during DKG transition fixing build issues split out ecash storage on nym-api side master-verification-key route caching all the signatures and keys implemented aggregated routes for nym-apis swagger UI for ecash endpoints added explicit annotation for index and expiration signatures revamped client ticketbook storage save all recovery information in the same underlying storage wrapper for bloomfilter being more aggressive with marking tickets as used ensure client has correct signatures before making deposit fix deserialisation of AggregatedExpirationDateSignatureResponse + add ticketbook table split nym-api ecash routes handlers into multiple files fixed deserialisation of encoded expiration date add tt_gamma1 to challenge and change naming for paper consistency rotating double spending bloomfilter nym-api test fixes + make sure to insert initial BF params fixed ecash benchmark code updated contract schema updated CI to not upload gateway/mixnode binaries ticket bandwidth revocation added default deserialisation for zk nym config post-rebase fixes
189 lines
6.2 KiB
Makefile
189 lines
6.2 KiB
Makefile
# Top-level Makefile for the nym monorepo
|
|
|
|
# Default target. Probably what you want to run in normal day-to-day usage when
|
|
# you want to check all backend code in one step.
|
|
all: test
|
|
|
|
help:
|
|
@echo "The main targets are"
|
|
@echo " all: the default target. Alias for test"
|
|
@echo " build: build all binaries"
|
|
@echo " build-release: build platform binaries and contracts in release mode"
|
|
@echo " clippy: run clippy for all workspaces"
|
|
@echo " test: run clippy, unit tests, and formatting."
|
|
@echo " test-all: like test, but also includes the expensive tests"
|
|
@echo " deb: build debian packages
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Meta targets
|
|
# -----------------------------------------------------------------------------
|
|
|
|
# Run clippy for all workspaces, run all tests, format all Rust code
|
|
test: clippy cargo-test fmt
|
|
|
|
# Same as test, but also runs slow tests
|
|
test-all: test cargo-test-expensive
|
|
|
|
# Build release binaries for the main workspace (platform binaries) and the
|
|
# contracts, including running wasm-opt.
|
|
# Producing release versions of other components is deferred to their
|
|
# respective toolchains.
|
|
build-release: build-release-main contracts
|
|
|
|
# Not a meta target, more of a top-level target for building all binaries (in
|
|
# debug mode). Listed here for visibility. The deps are appended successively
|
|
build:
|
|
|
|
# Not a meta target, more of a top-level target for clippy. Listed here for
|
|
# visibility. The deps are appended successively.
|
|
clippy:
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Define targets for a given workspace
|
|
# $(1): name
|
|
# $(2): path to workspace
|
|
# $(3): extra arguments to cargo
|
|
# $(4): RUSTFLAGS prefix env
|
|
# -----------------------------------------------------------------------------
|
|
define add_cargo_workspace
|
|
|
|
check-$(1):
|
|
cargo check --manifest-path $(2)/Cargo.toml --workspace $(3)
|
|
|
|
build-$(1):
|
|
cargo build --manifest-path $(2)/Cargo.toml --workspace $(3)
|
|
|
|
build-extra-$(1):
|
|
cargo build --manifest-path $(2)/Cargo.toml --workspace --examples --tests
|
|
|
|
build-release-$(1):
|
|
$(4) cargo $$($(1)_BUILD_RELEASE_TOOLCHAIN) build --manifest-path $(2)/Cargo.toml --workspace --release $(3)
|
|
|
|
test-$(1):
|
|
cargo test --manifest-path $(2)/Cargo.toml --workspace
|
|
|
|
test-expensive-$(1):
|
|
cargo test --manifest-path $(2)/Cargo.toml --workspace -- --ignored
|
|
|
|
clippy-$(1):
|
|
cargo $$($(1)_CLIPPY_TOOLCHAIN) clippy --manifest-path $(2)/Cargo.toml --workspace $(3) -- -D warnings
|
|
|
|
clippy-extra-$(1):
|
|
cargo $$($(1)_CLIPPY_TOOLCHAIN) clippy --manifest-path $(2)/Cargo.toml --workspace --examples --tests -- -D warnings
|
|
|
|
fmt-$(1):
|
|
cargo fmt --manifest-path $(2)/Cargo.toml --all
|
|
|
|
check: check-$(1)
|
|
build: build-$(1) build-extra-$(1)
|
|
build-release-all: build-release-$(1)
|
|
cargo-test: test-$(1)
|
|
cargo-test-expensive: test-expensive-$(1)
|
|
clippy: clippy-$(1) clippy-extra-$(1)
|
|
fmt: fmt-$(1)
|
|
endef
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Rust workspaces
|
|
# -----------------------------------------------------------------------------
|
|
|
|
# Generate targets for the various cargo workspaces
|
|
|
|
$(eval $(call add_cargo_workspace,main,.))
|
|
$(eval $(call add_cargo_workspace,contracts,contracts,--lib --target wasm32-unknown-unknown,RUSTFLAGS='-C link-arg=-s'))
|
|
$(eval $(call add_cargo_workspace,wallet,nym-wallet))
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# SDK
|
|
# -----------------------------------------------------------------------------
|
|
|
|
sdk-wasm: sdk-wasm-build sdk-wasm-test sdk-wasm-lint
|
|
|
|
sdk-wasm-build:
|
|
$(MAKE) -C nym-browser-extension/storage wasm-pack
|
|
$(MAKE) -C wasm/client
|
|
$(MAKE) -C wasm/node-tester
|
|
$(MAKE) -C wasm/mix-fetch
|
|
$(MAKE) -C wasm/zknym-lib
|
|
#$(MAKE) -C wasm/full-nym-wasm
|
|
|
|
# run this from npm/yarn to ensure tools are in the path, e.g. yarn build:sdk from root of repo
|
|
sdk-typescript-build:
|
|
npx lerna run --scope @nymproject/sdk build --stream
|
|
npx lerna run --scope @nymproject/mix-fetch build --stream
|
|
npx lerna run --scope @nymproject/node-tester build --stream
|
|
yarn --cwd sdk/typescript/codegen/contract-clients build
|
|
|
|
# NOTE: These targets are part of the main workspace (but not as wasm32-unknown-unknown)
|
|
WASM_CRATES = extension-storage nym-client-wasm nym-node-tester-wasm zknym-lib
|
|
|
|
sdk-wasm-test:
|
|
#cargo test $(addprefix -p , $(WASM_CRATES)) --target wasm32-unknown-unknown -- -Dwarnings
|
|
|
|
sdk-wasm-lint:
|
|
cargo clippy $(addprefix -p , $(WASM_CRATES)) --target wasm32-unknown-unknown -- -Dwarnings
|
|
$(MAKE) -C wasm/mix-fetch check-fmt
|
|
|
|
# Add to top-level targets
|
|
build: sdk-wasm-build
|
|
cargo-test: sdk-wasm-test
|
|
clippy: sdk-wasm-lint
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Build contracts ready for deploy
|
|
# -----------------------------------------------------------------------------
|
|
|
|
CONTRACTS=vesting_contract mixnet_contract nym_ecash
|
|
CONTRACTS_WASM=$(addsuffix .wasm, $(CONTRACTS))
|
|
CONTRACTS_OUT_DIR=contracts/target/wasm32-unknown-unknown/release
|
|
|
|
contracts: build-release-contracts wasm-opt-contracts
|
|
|
|
wasm-opt-contracts:
|
|
for contract in $(CONTRACTS_WASM); do \
|
|
wasm-opt --signext-lowering -Os $(CONTRACTS_OUT_DIR)/$$contract -o $(CONTRACTS_OUT_DIR)/$$contract; \
|
|
done
|
|
|
|
# Consider adding 's' to make plural consistent (beware: used in github workflow)
|
|
contract-schema:
|
|
$(MAKE) -C contracts schema
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Convenience targets for crates that are already part of the main workspace
|
|
# -----------------------------------------------------------------------------
|
|
|
|
build-explorer-api:
|
|
cargo build -p explorer-api
|
|
|
|
build-nym-cli:
|
|
cargo build -p nym-cli --release
|
|
|
|
build-nym-gateway:
|
|
cargo build -p nym-gateway --release
|
|
|
|
build-nym-mixnode:
|
|
cargo build -p nym-mixnode --release
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Misc
|
|
# -----------------------------------------------------------------------------
|
|
|
|
generate-typescript:
|
|
cd tools/ts-rs-cli && cargo run && cd ../..
|
|
yarn types:lint:fix
|
|
|
|
run-api-tests:
|
|
cd nym-api/tests/functional_test && yarn test:qa
|
|
|
|
# Build debian package, and update PPA
|
|
deb-mixnode: build-nym-mixnode
|
|
cargo deb -p nym-mixnode
|
|
|
|
deb-gateway: build-nym-gateway
|
|
cargo deb -p nym-gateway
|
|
|
|
deb-cli: build-nym-cli
|
|
cargo deb -p nym-cli
|
|
|
|
deb: deb-mixnode deb-gateway deb-cli
|