Skip to content

Commit

Permalink
Merge pull request #4626 from iron-fish/staging
Browse files Browse the repository at this point in the history
STAGING -> MASTER
  • Loading branch information
NullSoldier authored Jan 29, 2024
2 parents ed05969 + da6dd2b commit a12ebdd
Show file tree
Hide file tree
Showing 87 changed files with 4,488 additions and 2,057 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ See https://ironfish.network

The following steps should only be used to install if you are planning on contributing to the Iron Fish codebase. Otherwise, we **strongly** recommend using the installation methods here: https://ironfish.network/use/get-started/installation

1. Install [Node.js LTS](https://nodejs.org/en/download/)
1. Install [Node.js 20 LTS (or greater)](https://nodejs.org/en/download/).
1. Install [Rust](https://www.rust-lang.org/learn/get-started).
1. Install [Yarn](https://classic.yarnpkg.com/en/docs/install).
1. Windows:
Expand Down Expand Up @@ -52,6 +52,8 @@ Once your environment is set up - you can run the CLI by following [these direct

## Running Tests

> **Note:** Running tests requires Node.js 20 or greater.
1. To test the entire monorepo:
1. Run `yarn test` at the root of the repository
1. Run `yarn test:slow` in ./ironfish/ to run slow tests
Expand Down
6 changes: 3 additions & 3 deletions ironfish-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ironfish",
"version": "1.17.0",
"version": "1.18.0",
"description": "CLI for running and interacting with an Iron Fish node",
"author": "Iron Fish <[email protected]> (https://ironfish.network)",
"main": "build/src/index.js",
Expand Down Expand Up @@ -62,8 +62,8 @@
"@aws-sdk/client-s3": "3",
"@aws-sdk/client-secrets-manager": "3",
"@aws-sdk/s3-request-presigner": "3",
"@ironfish/rust-nodejs": "1.14.0",
"@ironfish/sdk": "1.17.0",
"@ironfish/rust-nodejs": "1.15.0",
"@ironfish/sdk": "1.18.0",
"@oclif/core": "1.23.1",
"@oclif/plugin-help": "5.1.12",
"@oclif/plugin-not-found": "2.3.1",
Expand Down
4 changes: 4 additions & 0 deletions ironfish-cli/src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,13 @@ export abstract class IronfishCommand extends Command {
const rpcTcpHostFlag = getFlag(flags, RpcTcpHostFlagKey)
if (typeof rpcTcpHostFlag === 'string') {
configOverrides.rpcTcpHost = rpcTcpHostFlag
configOverrides.enableRpcTcp = true
}

const rpcTcpPortFlag = getFlag(flags, RpcTcpPortFlagKey)
if (typeof rpcTcpPortFlag === 'number') {
configOverrides.rpcTcpPort = rpcTcpPortFlag
configOverrides.enableRpcTcp = true
}

const rpcConnectHttpFlag = getFlag(flags, RpcUseHttpFlagKey)
Expand All @@ -152,11 +154,13 @@ export abstract class IronfishCommand extends Command {
const rpcHttpHostFlag = getFlag(flags, RpcHttpHostFlagKey)
if (typeof rpcHttpHostFlag === 'string') {
configOverrides.rpcHttpHost = rpcHttpHostFlag
configOverrides.enableRpcHttp = true
}

const rpcHttpPortFlag = getFlag(flags, RpcHttpPortFlagKey)
if (typeof rpcHttpPortFlag === 'number') {
configOverrides.rpcHttpPort = rpcHttpPortFlag
configOverrides.enableRpcHttp = true
}

const rpcTcpTlsFlag = getFlag(flags, RpcTcpTlsFlagKey)
Expand Down
11 changes: 4 additions & 7 deletions ironfish-cli/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,16 @@ export default class Start extends IronfishCommand {
'Cannot specify both the networkId and customNetwork flags at the same time',
)
}
if (networkId !== undefined && networkId !== this.sdk.config.get('networkId')) {
this.sdk.config.setOverride('networkId', networkId)
}
if (customNetwork !== undefined && customNetwork !== this.sdk.config.get('customNetwork')) {
this.sdk.config.setOverride('customNetwork', customNetwork)
}

if (!this.sdk.internal.get('telemetryNodeId')) {
this.sdk.internal.set('telemetryNodeId', uuid())
await this.sdk.internal.save()
}

const node = await this.sdk.node()
const node = await this.sdk.node({
customNetworkPath: customNetwork,
networkId,
})

const nodeName = this.sdk.config.get('nodeName').trim() || null
const blockGraffiti = this.sdk.config.get('blockGraffiti').trim() || null
Expand Down
1 change: 1 addition & 0 deletions ironfish-rust-nodejs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ ironfish = { path = "../ironfish-rust" }
ironfish_mpc = { path = "../ironfish-mpc" }
napi = { version = "2.13.2", features = ["napi6"] }
napi-derive = "2.13.0"
rand = "0.8.5"

[build-dependencies]
napi-build = "2.0.1"
32 changes: 25 additions & 7 deletions ironfish-rust-nodejs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

/* auto-generated by NAPI-RS */

export interface RoundOneSigningData {
nonceHiding: string
nonceBinding: string
commitmentHiding: string
commitmentBinding: string
export interface SigningCommitments {
hiding: string
binding: string
}
export function roundOne(keyPackage: string, seed: number): RoundOneSigningData
export function roundOne(keyPackage: string, seed: number): SigningCommitments
export function roundTwo(signingPackage: string, keyPackage: string, publicKeyRandomness: string, seed: number): string
export function splitSecret(coordinatorSaplingKey: string, minSigners: number, maxSigners: number, identifiers: Array<string>): TrustedDealerKeyPackages
export function contribute(inputPath: string, outputPath: string, seed?: string | undefined | null): Promise<string>
export function verifyTransform(paramsPath: string, newParamsPath: string): Promise<string>
export const KEY_LENGTH: number
Expand Down Expand Up @@ -56,14 +56,18 @@ export const TRANSACTION_EXPIRATION_LENGTH: number
export const TRANSACTION_FEE_LENGTH: number
export const LATEST_TRANSACTION_VERSION: number
export function verifyTransactions(serializedTransactions: Array<Buffer>): boolean
export interface IdentiferKeyPackage {
identifier: string
keyPackage: string
}
export interface TrustedDealerKeyPackages {
verifyingKey: string
proofGenerationKey: string
viewKey: string
incomingViewKey: string
outgoingViewKey: string
publicAddress: string
keyPackages: Record<string, string>
keyPackages: Array<IdentiferKeyPackage>
publicKeyPackage: string
}
export const enum LanguageCode {
Expand Down Expand Up @@ -95,6 +99,17 @@ export class FishHashContext {
prebuildDataset(threads: number): void
hash(header: Buffer): Buffer
}
export class ParticipantSecret {
constructor(jsBytes: Buffer)
serialize(): Buffer
static random(): ParticipantSecret
toIdentity(): ParticipantIdentity
}
export class ParticipantIdentity {
constructor(jsBytes: Buffer)
serialize(): Buffer
toFrostIdentifier(): string
}
export class BoxKeyPair {
constructor()
static fromHex(secretHex: string): BoxKeyPair
Expand Down Expand Up @@ -230,6 +245,9 @@ export type NativeUnsignedTransaction = UnsignedTransaction
export class UnsignedTransaction {
constructor(jsBytes: Buffer)
serialize(): Buffer
publicKeyRandomness(): string
signingPackage(nativeCommitments: Record<string, SigningCommitments>): string
signFrost(publicKeyPackageStr: string, signingPackageStr: string, signatureSharesMap: Record<string, string>): Buffer
}
export class FoundBlockResult {
randomness: string
Expand Down
6 changes: 5 additions & 1 deletion ironfish-rust-nodejs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,14 @@ if (!nativeBinding) {
throw new Error(`Failed to load native binding`)
}

const { FishHashContext, roundOne, contribute, verifyTransform, KEY_LENGTH, NONCE_LENGTH, BoxKeyPair, randomBytes, boxMessage, unboxMessage, RollingFilter, initSignalHandler, triggerSegfault, ASSET_ID_LENGTH, ASSET_METADATA_LENGTH, ASSET_NAME_LENGTH, ASSET_LENGTH, Asset, NOTE_ENCRYPTION_KEY_LENGTH, MAC_LENGTH, ENCRYPTED_NOTE_PLAINTEXT_LENGTH, ENCRYPTED_NOTE_LENGTH, NoteEncrypted, PUBLIC_ADDRESS_LENGTH, RANDOMNESS_LENGTH, MEMO_LENGTH, AMOUNT_VALUE_LENGTH, DECRYPTED_NOTE_LENGTH, Note, PROOF_LENGTH, TRANSACTION_SIGNATURE_LENGTH, TRANSACTION_PUBLIC_KEY_RANDOMNESS_LENGTH, TRANSACTION_EXPIRATION_LENGTH, TRANSACTION_FEE_LENGTH, LATEST_TRANSACTION_VERSION, TransactionPosted, Transaction, verifyTransactions, UnsignedTransaction, LanguageCode, generateKey, spendingKeyToWords, wordsToSpendingKey, generateKeyFromPrivateKey, initializeSapling, FoundBlockResult, ThreadPoolHandler, isValidPublicAddress } = nativeBinding
const { FishHashContext, roundOne, roundTwo, ParticipantSecret, ParticipantIdentity, splitSecret, contribute, verifyTransform, KEY_LENGTH, NONCE_LENGTH, BoxKeyPair, randomBytes, boxMessage, unboxMessage, RollingFilter, initSignalHandler, triggerSegfault, ASSET_ID_LENGTH, ASSET_METADATA_LENGTH, ASSET_NAME_LENGTH, ASSET_LENGTH, Asset, NOTE_ENCRYPTION_KEY_LENGTH, MAC_LENGTH, ENCRYPTED_NOTE_PLAINTEXT_LENGTH, ENCRYPTED_NOTE_LENGTH, NoteEncrypted, PUBLIC_ADDRESS_LENGTH, RANDOMNESS_LENGTH, MEMO_LENGTH, AMOUNT_VALUE_LENGTH, DECRYPTED_NOTE_LENGTH, Note, PROOF_LENGTH, TRANSACTION_SIGNATURE_LENGTH, TRANSACTION_PUBLIC_KEY_RANDOMNESS_LENGTH, TRANSACTION_EXPIRATION_LENGTH, TRANSACTION_FEE_LENGTH, LATEST_TRANSACTION_VERSION, TransactionPosted, Transaction, verifyTransactions, UnsignedTransaction, LanguageCode, generateKey, spendingKeyToWords, wordsToSpendingKey, generateKeyFromPrivateKey, initializeSapling, FoundBlockResult, ThreadPoolHandler, isValidPublicAddress } = nativeBinding

module.exports.FishHashContext = FishHashContext
module.exports.roundOne = roundOne
module.exports.roundTwo = roundTwo
module.exports.ParticipantSecret = ParticipantSecret
module.exports.ParticipantIdentity = ParticipantIdentity
module.exports.splitSecret = splitSecret
module.exports.contribute = contribute
module.exports.verifyTransform = verifyTransform
module.exports.KEY_LENGTH = KEY_LENGTH
Expand Down
2 changes: 1 addition & 1 deletion ironfish-rust-nodejs/npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ironfish/rust-nodejs-darwin-arm64",
"version": "1.14.0",
"version": "1.15.0",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion ironfish-rust-nodejs/npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ironfish/rust-nodejs-darwin-x64",
"version": "1.14.0",
"version": "1.15.0",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion ironfish-rust-nodejs/npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ironfish/rust-nodejs-linux-arm64-gnu",
"version": "1.14.0",
"version": "1.15.0",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion ironfish-rust-nodejs/npm/linux-arm64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ironfish/rust-nodejs-linux-arm64-musl",
"version": "1.14.0",
"version": "1.15.0",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion ironfish-rust-nodejs/npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ironfish/rust-nodejs-linux-x64-gnu",
"version": "1.14.0",
"version": "1.15.0",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion ironfish-rust-nodejs/npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ironfish/rust-nodejs-linux-x64-musl",
"version": "1.14.0",
"version": "1.15.0",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion ironfish-rust-nodejs/npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ironfish/rust-nodejs-win32-x64-msvc",
"version": "1.14.0",
"version": "1.15.0",
"os": [
"win32"
],
Expand Down
2 changes: 1 addition & 1 deletion ironfish-rust-nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ironfish/rust-nodejs",
"version": "1.14.0",
"version": "1.15.0",
"description": "Node.js bindings for Rust code required by the Iron Fish SDK",
"main": "index.js",
"types": "index.d.ts",
Expand Down
Loading

0 comments on commit a12ebdd

Please sign in to comment.