Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Send in the whole chunk and process it in wasm #103

Closed
wants to merge 13 commits into from
Closed
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
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.wasm32-unknown-unknown]
rustflags = ["-C", "target-feature=+simd128"]
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ Cargo.lock
**/*.rs.bk

mod.wasm

.DS_Store
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.1]

### Added
- Add the compact module to make the web assembly API compatiblite on non rust endpoints
- Add support for phoenix_core methods
- Add support for stake contract functions
- Add support for transfer contract functions

### Changed
- Change the whole api to support `wasm32-unkonwn-unknown`
- Set json as the function argument and return value format with types defined in assets/schema.json

### Fixed
- Pass in the Fee and the crossover instead of creating it from rng at wallet-core side which caused courrpted proof
- Fix the input selecting algorithm from custom new one to old wallet-core to fix wrong picking of notes
- Fix the execute to work with only one public spend key and one `Transaction`

## [Old Changelog below]

## [Unreleased]

### Added
Expand Down
9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dusk-wallet-core"
version = "0.21.6"
version = "0.21.8"
edition = "2021"
description = "The core functionality of the Dusk wallet"
license = "MPL-2.0"
Expand Down Expand Up @@ -55,7 +55,6 @@ hex = { version = "0.4", default-features = false, features = ["alloc"] }
hashbrown = "0.14.3"
stake-contract-types = "0.1.0-rc"


[features]
# rust platforms can use this module without the compact feature
default = ["compat"]
Expand All @@ -73,3 +72,9 @@ wasmtime = "20"

[build-dependencies]
schemafy_lib = "0.6"

[profile.release]
lto = true
codegen-units = 1
opt-level = 'z'
wasm-opt = ['-O3']
Binary file modified assets/dusk_wallet_core.wasm
Binary file not shown.
88 changes: 42 additions & 46 deletions assets/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -448,32 +448,29 @@
}
}
},
"RkyvTreeLeafResponse": {
"description": "The response of the public_keys function",
"RkyvTreeLeafArgs": {
"description": "The arguments of the rkyv tree leaf function",
"type": "object",
"required": [
"block_height",
"note",
"last_pos"
"bytes",
"seed"
],
"properties": {
"block_height": {
"description": "The block height of the note.",
"type": "integer",
"format": "uint64"
},
"note": {
"description": "Bytes of note at the block_height",
"bytes": {
"description": "Bytes that are rkyv serialized into a phoenix_core::transaction::TreeLeaf",
"type": "array",
"items": {
"type": "integer",
"format": "uint8"
}
},
"last_pos": {
"description": "Last position of the note",
"type": "integer",
"format": "uint64"
"seed": {
"description": "Seed used to derive the keys of the wallet",
"type": "array",
"items": {
"type": "integer",
"format": "uint8"
}
}
}
},
Expand Down Expand Up @@ -576,49 +573,48 @@
}
}
},
"CheckNoteOwnershipArgs": {
"description": "Arguments of the check_note_ownership function",
"CheckNoteOwnershipResponse": {
"description": "Response of check_note_ownership function",
"type": "object",
"required": ["note", "seed"],
"required": ["notes", "last_pos", "block_heights", "public_spend_keys", "nullifiers"],
"properties": {
"note": {
"description": "A singular note we want to check the validity of",
"notes": {
"description": "The raw owned note",
"type": "array",
"items": {
"type": "integer",
"format": "uint8"
"type": "array",
"items": {
"type": "integer",
"format": "uint8"
}
}
},
"seed": {
"description": "The seed to generate the view keys from",
"last_pos": {
"description": "The last position of the note",
"type": "integer",
"format": "uint64"
},
"block_heights": {
"description": "The block heights of the notes in the same order the notes were returned seperated by comma",
"type": "string"
},
"public_spend_keys": {
"description": "The public spend keys of the notes in the same order the notes were returned",
"type": "array",
"items": {
"type": "integer",
"format": "uint8"
"type": "string"
}
}
}
},
"CheckNoteOwnershipResponse": {
"description": "Response of check_note_ownership function",
"type": "object",
"required": ["is_owned", "nullifier"],
"properties": {
"is_owned": {
"description": "Is the note owned by any of the view keys in the provided seed",
"type": "boolean"
},
"nullifier": {
"description": "Nullifier of the note that we were checking the ownership of",
"nullifiers": {
"description": "The nullifiers of the notes in the same order the notes were returned",
"type": "array",
"items": {
"type": "integer",
"format": "uint8"
"type": "array",
"items": {
"type": "integer",
"format": "uint8"
}
}
},
"public_key": {
"description": "A base 58 encoded public key string",
"type": "string"
}
}
},
Expand Down
4 changes: 0 additions & 4 deletions build.sh

This file was deleted.

Binary file removed dusk-wallet-core-0.21.0.wasm
Binary file not shown.
108 changes: 0 additions & 108 deletions src/compat/allow.rs

This file was deleted.

Loading
Loading