Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging -> Master #4752

Merged
merged 80 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
7d5ea2c
adds a test case for v1.17.0 bech32 encoding (#4659)
hughy Feb 1, 2024
781ca4b
adds BuildTransaction worker job (#4637)
hughy Feb 1, 2024
73ff4f6
fixes BuildTransaction worker task (#4662)
hughy Feb 1, 2024
22e5c70
Reorganize each definition file to be (#4664)
NullSoldier Feb 1, 2024
2c15f16
Rahul/ifl 2136 add proof authorizing key to account value (#4636)
patnir Feb 2, 2024
465ee8f
Move Consensus into Network (#4646)
NullSoldier Feb 2, 2024
0928938
using proof authorizing key in useUnsignedTxFixture (#4666)
patnir Feb 2, 2024
c3e63f2
Use helper functions for updating blockchain sequence->hashes index (…
danield9tqh Feb 2, 2024
395ec69
feat(ironfish): Add public key package to account (#4652)
rohanjadvani Feb 2, 2024
c63b476
test(ironfish): Add coordinator account to integration frost test (#4…
rohanjadvani Feb 2, 2024
6a5140c
fix: signing share rpc bug (#4670)
jowparks Feb 2, 2024
4b018f7
adds wallet/buildTransaction RPC (#4642)
hughy Feb 5, 2024
24c061f
feat: add multisig create account (#4667)
jowparks Feb 5, 2024
b4f0a93
adds unsignedTransaction flag to send command (#4671)
hughy Feb 5, 2024
65bf26c
Rahul/ifl 2178 remove max signers input from split spender key (#4674)
patnir Feb 5, 2024
18e5ef4
Verify mint ownership on block connect instead of on add (#4665)
danield9tqh Feb 5, 2024
36b4145
feat(ironfish): Add base64json encoder (#4675)
rohanjadvani Feb 5, 2024
ea7d061
Rahul/ifl 2181 remove maxsigners from split secret rpc (#4676)
patnir Feb 5, 2024
a32b217
adds multisig/aggregateSigningShares RPC (#4677)
hughy Feb 5, 2024
4a73e1d
Rahul/create signing commitment returns identifier with commitment (#…
patnir Feb 5, 2024
5611947
feat(cli,ironfish): Update multisig account creation output to base64…
rohanjadvani Feb 6, 2024
0c7b49c
feat(cli,ironfish): Use base64json instead of bech32 (#4678)
rohanjadvani Feb 6, 2024
27fb485
chore: move multisig into wallet namespace (#4682)
jowparks Feb 6, 2024
78efa2d
refactor: change aggregate signing share to take in account (#4687)
jowparks Feb 6, 2024
237fdfb
adds function to assert that an account is a multisig account (#4688)
hughy Feb 6, 2024
f2f9244
changes createSigningShare RPC to take an account name (#4690)
hughy Feb 6, 2024
85fb937
Rahul/ifl 2187 replace keypackage with account name input for (#4689)
patnir Feb 6, 2024
b859447
refactor: change signature share serialization so that it returns a o…
jowparks Feb 6, 2024
8cae60e
chore: rename signFrost to aggregateSignatureShares (#4693)
jowparks Feb 6, 2024
71d2233
Rahul/adds error message to multi sig signer assert (#4692)
patnir Feb 6, 2024
4f46bf3
Allow user to input a new name if duplicate (#4695)
NullSoldier Feb 6, 2024
f3f1922
renames SigningShare to SignatureShare (#4694)
hughy Feb 6, 2024
2c7ac29
feat(ironfish): Update signing commitment to be a buffer/string (#4696)
rohanjadvani Feb 6, 2024
4fdd183
allows minting asset with 0 supply (#4684)
hughy Feb 7, 2024
d0a98c5
chore: refactor naming multisig (#4697)
jowparks Feb 7, 2024
4255185
feat(IFL-2173): create signing package cli (#4673)
jowparks Feb 7, 2024
01e3112
Change consensus params type to nullable (#4699)
danield9tqh Feb 7, 2024
63b5541
uses AssertMultiSig in aggregateSignatureShares (#4702)
hughy Feb 7, 2024
9b83e1a
Remove uses of `ThreadRng`
andreacorbellini Feb 7, 2024
f4abdd6
Update `ironfish-frost` to the latest version
andreacorbellini Feb 7, 2024
5de79eb
Fix multiple display_trace definitions on android build (#4700)
dguenther Feb 7, 2024
e82846f
feat(IFL-2172): create signing commitment cli (#4669)
jowparks Feb 7, 2024
53a2257
feat(IFL-2174): create signing share cli (#4672)
jowparks Feb 7, 2024
40074d4
feat(cli,ironfish): Add `wallet:multisig:sign` (#4685)
patnir Feb 7, 2024
48abe1b
feat(cli): Improve multisig account creation (#4705)
rohanjadvani Feb 7, 2024
a10c9b4
adds multisig RPC integration test (#4681)
hughy Feb 7, 2024
ddf1e95
adds wallet:multisig:identity:create (#4707)
hughy Feb 7, 2024
062269e
Prefer `ironfish_rust::participant::Identity` over `frost::Identifier`
andreacorbellini Feb 7, 2024
b20b7b6
fix(cli,ironfish): Fix broadcast in aggregating shares (#4709)
rohanjadvani Feb 7, 2024
36676a4
fix(cli): Fix hardcoded name (#4708)
rohanjadvani Feb 7, 2024
bcce46c
make account param optional for createSignatureShare (#4710)
patnir Feb 7, 2024
a74c131
fixes creating unsigned tx from non-default account (#4711)
hughy Feb 7, 2024
c164bb4
Prompt user to enter a name for nameless account (#4706)
NullSoldier Feb 8, 2024
1a23037
Add `useAccountAndAddFundsFixture` to simplify tests
andreacorbellini Feb 7, 2024
5da0af2
Support TRM Stratum in testnet pool (#4595)
danield9tqh Feb 8, 2024
5737865
Add Ironfish Stratum V3 (post-fishhash) to reference pool (#4713)
danield9tqh Feb 9, 2024
ed86d43
Support V1 miner by default (#4714)
danield9tqh Feb 9, 2024
df84a1c
feat: adds long prompt method for input of lengthy text (#4716)
jowparks Feb 12, 2024
5f3598c
Fix flaky fileStore test (#4723)
danield9tqh Feb 13, 2024
2d90d90
chore: code comment encryption (#4720)
jowparks Feb 13, 2024
00811ee
`repeat` long prompt for account import (#4721)
patnir Feb 13, 2024
96effb3
Rahul/multisig prompt for inputs (#4725)
patnir Feb 13, 2024
38197ed
feat(cli): Ask for confirmation when creating signature share (#4729)
rohanjadvani Feb 13, 2024
831c300
fixes test that relies on outdated sdk behavior (#4730)
hughy Feb 13, 2024
ae5694a
fixes leftover use of 'Identifier' term (#4731)
hughy Feb 13, 2024
8f489cf
Add a consensus parameter for adjusting the max difficulty buckets (#…
mat-if Feb 13, 2024
c7d093d
Add a one-time difficulty adjustment when FishHash activates (#4715)
mat-if Feb 13, 2024
5c60cd9
Upgrade fish hash to include audit changes (#4722)
danield9tqh Feb 13, 2024
5ebb4c7
removing duplicate import name (#4733)
patnir Feb 14, 2024
a324340
removes duplicate check for duplicate name in createAccount (#4732)
hughy Feb 14, 2024
42deb52
Rahul/fix frost slow test (#4728)
patnir Feb 14, 2024
93103cf
Change multisig implementation to use deterministic nonces and commit…
andiflabs Feb 13, 2024
8279330
Rahul/unsigned transaction in signing package (#4734)
patnir Feb 15, 2024
8a920f1
removing unsigned transaction from aggregate signature share (#4739)
patnir Feb 15, 2024
a3bb842
Include the list of signers into the signing package
andiflabs Feb 16, 2024
9cee9d1
Add checkpoints to blockchain (#4683)
danield9tqh Feb 16, 2024
f2a4dc3
feat(ironfish,rust,rust-nodejs): Return descriptions from unsigned tr…
rohanjadvani Feb 20, 2024
acf138c
Add activation sequence for testnet (#4749)
danield9tqh Feb 20, 2024
b76dd56
Bump version to 1.20.0 (#4751)
danield9tqh Feb 20, 2024
c979262
Update frost-related Cargo dependencies
andiflabs Feb 20, 2024
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
19 changes: 11 additions & 8 deletions Cargo.lock

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

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.19.0",
"version": "1.20.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.16.0",
"@ironfish/sdk": "1.19.0",
"@ironfish/rust-nodejs": "1.17.0",
"@ironfish/sdk": "1.20.0",
"@oclif/core": "1.23.1",
"@oclif/plugin-help": "5.1.12",
"@oclif/plugin-not-found": "2.3.1",
Expand Down
2 changes: 1 addition & 1 deletion ironfish-cli/src/commands/wallet/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class ExportCommand extends IronfishCommand {
? AccountFormat.Mnemonic
: flags.json
? AccountFormat.JSON
: AccountFormat.Bech32
: AccountFormat.Base64Json

const client = await this.sdk.connectRpc(local)
const response = await client.wallet.exportAccount({
Expand Down
53 changes: 39 additions & 14 deletions ironfish-cli/src/commands/wallet/import.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import { PromiseUtils } from '@ironfish/sdk'
import { PromiseUtils, RPC_ERROR_CODES, RpcRequestError } from '@ironfish/sdk'
import { CliUx, Flags } from '@oclif/core'
import { IronfishCommand } from '../../command'
import { RemoteFlags } from '../../flags'
import { longPrompt } from '../../utils/longPrompt'

export class ImportCommand extends IronfishCommand {
static description = `Import an account`
Expand Down Expand Up @@ -78,11 +79,40 @@ export class ImportCommand extends IronfishCommand {
flags.name = name
}

const result = await client.wallet.importAccount({
account,
rescan: flags.rescan,
name: flags.name,
})
let result

while (!result) {
try {
result = await client.wallet.importAccount({
account,
rescan: flags.rescan,
name: flags.name,
})
} catch (e) {
if (
e instanceof RpcRequestError &&
(e.code === RPC_ERROR_CODES.DUPLICATE_ACCOUNT_NAME.toString() ||
e.code === RPC_ERROR_CODES.IMPORT_ACCOUNT_NAME_REQUIRED.toString())
) {
if (e.code === RPC_ERROR_CODES.DUPLICATE_ACCOUNT_NAME.toString()) {
this.log()
this.log(e.codeMessage)
}

const name = await CliUx.ux.prompt('Enter a name for the account', {
required: true,
})
if (name === flags.name) {
this.error(`Entered the same name: '${name}'`)
}

flags.name = name
continue
}

throw e
}
}

const { name, isDefaultAccount } = result.content
this.log(`Account ${name} imported.`)
Expand Down Expand Up @@ -120,13 +150,8 @@ export class ImportCommand extends IronfishCommand {
}

async importTTY(): Promise<string> {
const userInput = await CliUx.ux.prompt(
'Paste the output of wallet:export, or your spending key',
{
required: true,
},
)

return userInput.trim()
return await longPrompt('Paste the output of wallet:export, or your spending key: ', {
required: true,
})
}
}
2 changes: 1 addition & 1 deletion ironfish-cli/src/commands/wallet/mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class Mint extends IronfishCommand {
client: client,
required: true,
text: 'Enter the amount',
minimum: 1n,
minimum: 0n,
logger: this.logger,
})
}
Expand Down
136 changes: 136 additions & 0 deletions ironfish-cli/src/commands/wallet/multisig/account/create.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import { ACCOUNT_SCHEMA_VERSION, Base64JsonEncoder } from '@ironfish/sdk'
import { CliUx, Flags } from '@oclif/core'
import { IronfishCommand } from '../../../../command'
import { RemoteFlags } from '../../../../flags'

export class MultisigCreate extends IronfishCommand {
static description = `Create a set of multisig accounts from identities`
static hidden = true

static flags = {
...RemoteFlags,
name: Flags.string({
char: 'n',
description: 'Name to use for the coordinator',
}),
identity: Flags.string({
char: 'i',
description: 'Identity of a participant',
multiple: true,
}),
minSigners: Flags.integer({
char: 'm',
description: 'Minimum number of signers to meet signing threshold',
}),
importCoordinator: Flags.boolean({
char: 'c',
default: true,
description: 'Import the coordinator as a view-only account after creating key packages',
}),
}

async start(): Promise<void> {
const { flags } = await this.parse(MultisigCreate)

let identities = flags.identity
if (!identities || identities.length < 2) {
const input = await CliUx.ux.prompt('Enter the identities separated by commas', {
required: true,
})
identities = input.split(',')

if (identities.length < 2) {
this.error('Minimum number of identities must be at least 2')
}
}
identities = identities.map((i) => i.trim())

let minSigners = flags.minSigners
if (!minSigners) {
const input = await CliUx.ux.prompt('Enter the number of minimum signers', {
required: true,
})
minSigners = parseInt(input)
if (isNaN(minSigners) || minSigners < 2) {
this.error('Minimum number of signers must be at least 2')
}
}

const name =
flags.name?.trim() ??
(await CliUx.ux.prompt('Enter the name for the coordinator', { required: true }))

const client = await this.sdk.connectRpc()

const response = await client.wallet.multisig.createTrustedDealerKeyPackage({
minSigners,
participants: identities.map((identity) => ({ identity })),
})

const chainResponse = await client.chain.getChainInfo()
const hash = Buffer.from(chainResponse.content.currentBlockIdentifier.hash, 'hex')
const sequence = Number(chainResponse.content.currentBlockIdentifier.index)
const createdAt = {
hash,
sequence,
}

if (flags.importCoordinator) {
this.log()
CliUx.ux.action.start('Importing the coordinator as a view-only account')

await client.wallet.importAccount({
account: {
name,
version: ACCOUNT_SCHEMA_VERSION,
createdAt: {
hash: createdAt.hash.toString('hex'),
sequence: createdAt.sequence,
},
spendingKey: null,
viewKey: response.content.viewKey,
incomingViewKey: response.content.incomingViewKey,
outgoingViewKey: response.content.outgoingViewKey,
publicAddress: response.content.publicAddress,
proofAuthorizingKey: response.content.proofAuthorizingKey,
multisigKeys: {
publicKeyPackage: response.content.publicKeyPackage,
},
},
})

CliUx.ux.action.stop()
}

const encoder = new Base64JsonEncoder()

for (const [i, keyPackage] of response.content.keyPackages.entries()) {
this.log('\n')
this.log(`Account ${i + 1}`)
this.log(`Identity ${keyPackage.identity}`)
this.log('----------------')
const accountStr = encoder.encode({
name: `${name}-${i}`,
version: ACCOUNT_SCHEMA_VERSION,
createdAt,
spendingKey: null,
viewKey: response.content.viewKey,
incomingViewKey: response.content.incomingViewKey,
outgoingViewKey: response.content.outgoingViewKey,
publicAddress: response.content.publicAddress,
proofAuthorizingKey: response.content.proofAuthorizingKey,
multisigKeys: {
identity: keyPackage.identity,
keyPackage: keyPackage.keyPackage,
publicKeyPackage: response.content.publicKeyPackage,
},
})
this.log(accountStr)
}

this.log()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

import { CliUx, Flags } from '@oclif/core'
import { IronfishCommand } from '../../../command'
import { RemoteFlags } from '../../../flags'
import { longPrompt } from '../../../utils/longPrompt'

export class CreateSignatureShareCommand extends IronfishCommand {
static description = `Creates a signature share for a participant for a given transaction`
static hidden = true

static flags = {
...RemoteFlags,
account: Flags.string({
char: 'f',
description: 'The account from which the signature share will be created',
required: false,
}),
signingPackage: Flags.string({
char: 's',
description: 'The signing package for which the signature share will be created',
required: false,
}),
signerIdentity: Flags.string({
char: 'i',
description:
'The identity of the participants that will sign the transaction (may be specified multiple times to add multiple signers)',
required: true,
multiple: true,
}),
confirm: Flags.boolean({
default: false,
description: 'Confirm creating signature share without confirming',
}),
}

async start(): Promise<void> {
const { flags } = await this.parse(CreateSignatureShareCommand)
let signingPackage = flags.signingPackage?.trim()

if (!signingPackage) {
signingPackage = await longPrompt('Enter the signing package: ')
}

if (!flags.confirm) {
const confirmed = await CliUx.ux.confirm('Confirm new signature share creation (Y/N)')
if (!confirmed) {
this.error('Creating signature share aborted')
}
}

const client = await this.sdk.connectRpc()
const signatureShareResponse = await client.wallet.multisig.createSignatureShare({
account: flags.account,
signingPackage,
})

this.log('Signing Share:\n')
this.log(signatureShareResponse.content.signatureShare)
}
}
Loading
Loading