From 39ae73cb5868a9a011f633ef299f2c964313e1f7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 08:23:28 +0000 Subject: [PATCH 1/7] chore: Update ckb node assume valid target for rc/v0.116.0. --- packages/neuron-wallet/.env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/neuron-wallet/.env b/packages/neuron-wallet/.env index f32862920f..3c4d9296b8 100644 --- a/packages/neuron-wallet/.env +++ b/packages/neuron-wallet/.env @@ -117,5 +117,5 @@ DAO_CODE_HASH=0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e MULTISIG_CODE_HASH=0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8 # CKB NODE OPTIONS -CKB_NODE_ASSUME_VALID_TARGET='0x9443ad8da9172d484367bc5467988cba7a0c46028398309edfdda7d2d79be897' -CKB_NODE_DATA_SIZE=53 +CKB_NODE_ASSUME_VALID_TARGET='0x6dd077b407d019a0bce0cbad8c34e69a524ae4b2599b9feda2c7491f3559d32c' +CKB_NODE_DATA_SIZE=54 From bc4977f36b3ed2e543d12f201847226a65cbe035 Mon Sep 17 00:00:00 2001 From: Keith Date: Mon, 20 May 2024 18:20:37 +0900 Subject: [PATCH 2/7] chore: update versions and changelogs --- CHANGELOG.md | 30 +++++++++++++++++++++++++++++ lerna.json | 2 +- package.json | 2 +- packages/neuron-ui/package.json | 2 +- packages/neuron-wallet/package.json | 4 ++-- 5 files changed, 35 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a35aea95a9..f06bf33b2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,33 @@ +# 0.116.0 (2024-05-24) + +### CKB Node & Light Client + +- [CKB@v0.116.1](https://github.com/nervosnetwork/ckb/releases/tag/v0.116.1) was released on May. 11st, 2024. This version of CKB node is now bundled and preconfigured in Neuron. +- [CKB Light Client@v0.3.7](https://github.com/nervosnetwork/ckb-light-client/releases/tag/v0.3.7) was released on Apr. 13th, 2024. This version of CKB Light Client is now bundled and preconfigured in Neuron + +### Assumed valid target + +Block before `0x6dd077b407d019a0bce0cbad8c34e69a524ae4b2599b9feda2c7491f3559d32c`(at height `13,007,704`) will be skipped in validation.(https://github.com/nervosnetwork/neuron/pull/3157) + +--- + +## New features + +- 3134: Support 'replace-by-fee' nervos dao transactions and sudt transactions.(@devchenyan) +- 3144: Reduce size of light client log in debug information and reveal start-block-number in log.(@yanguoyu) +- 3064: Support locking window by pin code.(@yanguoyu) +- 3131: Add detailed result for nervos dao transaction.(@devchenyan) + +## Bug fixes + +- 3121: Locate the first transaction on Explorer directly when users want to set the start-block-number for light client.(@yanguoyu) +- 3101: Show migration instruction properly.(@devchenyan) +- 3062: Migrate legacy ACP to active ACP account(@yanguoyu) +- 3141: Fix some issues about light client synchronizaiton.(@yanguoyu) +- 3120: Remove all sync data when start-block-number is set less than before.(@yanguoyu) + +**Full Changelog**: https://github.com/nervosnetwork/neuron/compare/v0.114.3...v0.116.0 + # 0.114.3 (2024-04-16) ### CKB Node & Light Client diff --git a/lerna.json b/lerna.json index 0e77734cb4..922158bfd4 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "packages": ["packages/*"], - "version": "0.114.3", + "version": "0.116.0", "npmClient": "yarn", "$schema": "node_modules/lerna/schemas/lerna-schema.json" } diff --git a/package.json b/package.json index 62c7a5ad1b..e8c55808df 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "neuron", "productName": "Neuron", "description": "CKB Neuron Wallet", - "version": "0.114.3", + "version": "0.116.0", "private": true, "author": { "name": "Nervos Core Dev", diff --git a/packages/neuron-ui/package.json b/packages/neuron-ui/package.json index 5c6ce190e1..b98ed97822 100644 --- a/packages/neuron-ui/package.json +++ b/packages/neuron-ui/package.json @@ -1,6 +1,6 @@ { "name": "neuron-ui", - "version": "0.114.3", + "version": "0.116.0", "private": true, "author": { "name": "Nervos Core Dev", diff --git a/packages/neuron-wallet/package.json b/packages/neuron-wallet/package.json index 77479adeae..cad2f98bff 100644 --- a/packages/neuron-wallet/package.json +++ b/packages/neuron-wallet/package.json @@ -3,7 +3,7 @@ "productName": "Neuron", "description": "CKB Neuron Wallet", "homepage": "https://www.nervos.org/", - "version": "0.114.3", + "version": "0.116.0", "private": true, "author": { "name": "Nervos Core Dev", @@ -97,7 +97,7 @@ "electron-builder": "24.9.1", "electron-devtools-installer": "3.2.0", "jest-when": "3.6.0", - "neuron-ui": "0.114.3", + "neuron-ui": "0.116.0", "typescript": "5.3.3" } } From 286f199a2bc833343511d4f939eac6abed21650a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E5=9B=BD=E5=AE=87?= <841185308@qq.com> Date: Tue, 21 May 2024 17:43:27 +0800 Subject: [PATCH 3/7] fix: Use hex to avoid unexpected string. (#3162) --- packages/neuron-wallet/src/services/settings.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/neuron-wallet/src/services/settings.ts b/packages/neuron-wallet/src/services/settings.ts index d482390249..f836ba5e0e 100644 --- a/packages/neuron-wallet/src/services/settings.ts +++ b/packages/neuron-wallet/src/services/settings.ts @@ -88,7 +88,7 @@ export default class SettingsService extends Store { private generateEncryptString(str: string) { if (safeStorage.isEncryptionAvailable()) { - return safeStorage.encryptString(str).toString('utf-8') + return safeStorage.encryptString(str).toString('hex') } const hash = crypto.createHash('sha256') hash.update(str) @@ -108,6 +108,9 @@ export default class SettingsService extends Store { } verifyLockWindowPassword(password: string) { + if (safeStorage.isEncryptionAvailable()) { + return safeStorage.decryptString(Buffer.from(this.lockWindowInfo.encryptedPassword!, 'hex')) === password + } const encryptedPassword = this.generateEncryptString(password) return SettingsService.getInstance().lockWindowInfo.encryptedPassword === encryptedPassword } From 7b5c592aa8d6ba1e1ffb62a75164924ff917f4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E5=9B=BD=E5=AE=87?= <841185308@qq.com> Date: Wed, 22 May 2024 16:09:22 +0800 Subject: [PATCH 4/7] fix: Use lumos to init Buffer (#3164) --- packages/neuron-wallet/src/controllers/wallets.ts | 4 ++-- packages/neuron-wallet/src/services/sign-message.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/neuron-wallet/src/controllers/wallets.ts b/packages/neuron-wallet/src/controllers/wallets.ts index 29bff5030e..db66030bfa 100644 --- a/packages/neuron-wallet/src/controllers/wallets.ts +++ b/packages/neuron-wallet/src/controllers/wallets.ts @@ -168,8 +168,8 @@ export default class WalletsController { const keystoreObject = Keystore.fromJson(keystore) const masterPrivateKey = keystoreObject.extendedPrivateKey(password) const masterKeychain = new Keychain( - Buffer.from(masterPrivateKey.privateKey, 'hex'), - Buffer.from(masterPrivateKey.chainCode, 'hex') + Buffer.from(bytes.bytify(masterPrivateKey.privateKey)), + Buffer.from(bytes.bytify(masterPrivateKey.chainCode)) ) const accountKeychain = masterKeychain.derivePath(AccountExtendedPublicKey.ckbAccountPath) const accountExtendedPublicKey = new AccountExtendedPublicKey( diff --git a/packages/neuron-wallet/src/services/sign-message.ts b/packages/neuron-wallet/src/services/sign-message.ts index 8d3bfd562d..aeaf32dca7 100644 --- a/packages/neuron-wallet/src/services/sign-message.ts +++ b/packages/neuron-wallet/src/services/sign-message.ts @@ -6,6 +6,7 @@ import { ec as EC } from 'elliptic' import { AddressNotFound } from '../exceptions' import HardwareWalletService from './hardware' import AddressParser from '../models/address-parser' +import { bytes } from '@ckb-lumos/codec' export default class SignMessage { static GENERATE_COUNT = 100 @@ -91,8 +92,8 @@ export default class SignMessage { private static getPrivateKey(wallet: Wallet, path: string, password: string): string { const masterPrivateKey = wallet.loadKeystore().extendedPrivateKey(password) const masterKeychain = new Keychain( - Buffer.from(masterPrivateKey.privateKey, 'hex'), - Buffer.from(masterPrivateKey.chainCode, 'hex') + Buffer.from(bytes.bytify(masterPrivateKey.privateKey)), + Buffer.from(bytes.bytify(masterPrivateKey.chainCode)) ) return `0x${masterKeychain.derivePath(path).privateKey.toString('hex')}` From 99ca06e42978d257bc460e6901acb3038e05f251 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 10:59:14 +0900 Subject: [PATCH 5/7] Update Neuron compatibility table (#3158) feat: Update Neuron compatibility table Co-authored-by: Keith-CY --- compatible.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/compatible.json b/compatible.json index 028ff3cb04..b2865b7a18 100644 --- a/compatible.json +++ b/compatible.json @@ -99,6 +99,22 @@ "0.3", "0.2" ] + }, + "0.116": { + "full": [ + "0.116", + "0.115", + "0.114", + "0.113", + "0.112", + "0.111", + "0.110", + "0.109" + ], + "light": [ + "0.3", + "0.2" + ] } } } From ecd7fc99cf1a626d0801a18228ed5233dd40ea82 Mon Sep 17 00:00:00 2001 From: devchenyan Date: Thu, 23 May 2024 15:15:45 +0800 Subject: [PATCH 6/7] fix: amend transaction when consume cells (#3166) --- .../src/components/AmendSend/index.tsx | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/packages/neuron-ui/src/components/AmendSend/index.tsx b/packages/neuron-ui/src/components/AmendSend/index.tsx index 92eb75675d..7ba3873d1e 100644 --- a/packages/neuron-ui/src/components/AmendSend/index.tsx +++ b/packages/neuron-ui/src/components/AmendSend/index.tsx @@ -96,6 +96,15 @@ const AmendSend = () => { return '' } + const inputsCapacity = useMemo(() => { + if (transaction) { + return transaction.inputs.reduce((total, cur) => { + return total + BigInt(cur.capacity || '0') + }, BigInt(0)) + } + return undefined + }, [transaction]) + const items: { address: string amount: string @@ -103,21 +112,25 @@ const AmendSend = () => { isLastOutput: boolean output: State.DetailedOutput }[] = useMemo(() => { - if (transaction && transaction.outputs.length) { + if (transaction && transaction.outputs.length && inputsCapacity) { const lastOutputAddress = getLastOutputAddress(transaction.outputs) return transaction.outputs.map(output => { const address = scriptToAddress(output.lock, { isMainnet }) + const capacity = + transaction.outputs.length === 1 && address === lastOutputAddress + ? (inputsCapacity - fee).toString() + : output.capacity return { - capacity: output.capacity, + capacity, address, output, - amount: shannonToCKBFormatter(output.capacity || '0'), + amount: shannonToCKBFormatter(capacity || '0'), isLastOutput: address === lastOutputAddress, } }) } return [] - }, [transaction?.outputs]) + }, [transaction?.outputs, inputsCapacity, fee]) const outputsCapacity = useMemo(() => { const outputList = items.length === 1 ? items : items.filter(item => !item.isLastOutput) @@ -129,15 +142,15 @@ const AmendSend = () => { const totalAmount = shannonToCKBFormatter(outputsCapacity.toString()) const lastOutputsCapacity = useMemo(() => { - if (transaction) { - const inputsCapacity = transaction.inputs.reduce((total, cur) => { - return total + BigInt(cur.capacity || '0') - }, BigInt(0)) + if (inputsCapacity) { + if (items.length === 1) { + return BigInt(items[0].capacity || '0') + } return inputsCapacity - outputsCapacity - fee } return undefined - }, [transaction, fee, outputsCapacity]) + }, [inputsCapacity, fee, outputsCapacity, items]) useEffect(() => { if (transaction && lastOutputsCapacity !== undefined) { From 399a136d25f1e82a113bfcb788150d0c16dfda76 Mon Sep 17 00:00:00 2001 From: Keith Date: Thu, 23 May 2024 19:45:14 +0900 Subject: [PATCH 7/7] docs: add video introduction to v0.116.0 in changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f06bf33b2c..3c71658c54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ Block before `0x6dd077b407d019a0bce0cbad8c34e69a524ae4b2599b9feda2c7491f3559d32c --- +[![Neuron@v0.116.0](https://github.com/Magickbase/neuron-public-issues/assets/7271329/ec10aa01-47fe-47a3-9636-3d4e86fc6c9b)](https://youtu.be/QXv8by2C8zU) + +YouTube: https://youtu.be/QXv8by2C8zU + +--- + ## New features - 3134: Support 'replace-by-fee' nervos dao transactions and sudt transactions.(@devchenyan)