Skip to content

Commit 37bf320

Browse files
committed
Merge branch 'develop'
2 parents 33a50c9 + f3cc18a commit 37bf320

28 files changed

+1093
-147
lines changed

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
# 0.111.0 (2023-10-19)
2+
3+
### CKB Node & Light Client
4+
5+
- [CKB@v0.111.0](https://github.com/nervosnetwork/ckb/releases/tag/v0.111.0) was released on Sep. 14nd, 2023. This version of CKB node is now bundled and preconfigured in Neuron.
6+
- [CKB Light Client@v0.2.4](https://github.com/nervosnetwork/ckb-light-client/releases/tag/v0.2.4) was released on May. 28th, 2023. This version of CKB Light Client is now bundled and preconfigured in Neuron
7+
8+
#### Caveat
9+
10+
**CKB Light Client** is only activated on testnet, thus only `light testnet` is enabled in Neuron. **CKB Light Client on Mainnet** requires an activation on the mainnet, the timetable can be found at https://github.com/nervosnetwork/ckb/releases/tag/v0.110.1.
11+
12+
### Assumed valid target
13+
14+
Block before `0xd5e25ad24400f237aa5f72f3738a9ae77fe082a89937e75143fcc8ef5b009383`(at height `11,204,855`) will be skipped in validation.(https://github.com/nervosnetwork/neuron/pull/2881)
15+
16+
---
17+
18+
## Bug fixes
19+
20+
* #2869: Add a dialog for migration.(@yanguoyu)
21+
* #2870: Fix width of navbar.(@yanguoyu)
22+
* #2873: Fix fallback font on Linux.(@yanguoyu)
23+
24+
25+
**Full Changelog**: https://github.com/nervosnetwork/neuron/compare/v0.110.3...v0.111.0
26+
27+
128
# 0.110.3 (2023-10-11)
229

330
### CKB Node & Light Client

_typos.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
[default.extend-words]
22
thur = "thur"
3+
numer = "numer"
34

45
# defined in database schema
56
lastest = "lastest"
67

78
[files]
89
extend-exclude = ["CHANGELOG.md", "**/migrations/*.ts"]
9-
10-
11-

compatible.csv

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
CKB,0.110,0.109,0.108,0.107,0.106,0.105,0.104,0.103
2-
Neuron,,,,,,,,
3-
0.110,yes,yes,no,no,no,no,no,no
4-
0.106,no,no,yes,yes,yes,yes,no,no
5-
0.103,no,no,no,no,no,no,yes,yes
1+
CKB,0.111,0.110,0.109,0.108,0.107,0.106,0.105,0.104,0.103
2+
Neuron,,,,,,,,,
3+
0.111,yes,yes,yes,no,no,no,no,no,no
4+
0.110,yes,yes,yes,no,no,no,no,no,no
5+
0.106,no,no,no,yes,yes,yes,yes,no,no
6+
0.103,no,no,no,no,no,no,no,yes,yes

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"packages": ["packages/*"],
3-
"version": "0.110.3",
3+
"version": "0.111.0",
44
"npmClient": "yarn",
55
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
66
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "neuron",
33
"productName": "Neuron",
44
"description": "CKB Neuron Wallet",
5-
"version": "0.110.3",
5+
"version": "0.111.0",
66
"private": true,
77
"author": {
88
"name": "Nervos Core Dev",

packages/neuron-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "neuron-ui",
3-
"version": "0.110.3",
3+
"version": "0.111.0",
44
"private": true,
55
"author": {
66
"name": "Nervos Core Dev",

packages/neuron-wallet/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,4 @@ DAO_CODE_HASH=0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e
117117
MULTISIG_CODE_HASH=0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8
118118

119119
# CKB NODE OPTIONS
120-
CKB_NODE_ASSUME_VALID_TARGET='0x6b6db6bb23e6e98f63b88e6cd38fa49f46980e5b816f620c71c6c9c74633ee54'
120+
CKB_NODE_ASSUME_VALID_TARGET='0xd5e25ad24400f237aa5f72f3738a9ae77fe082a89937e75143fcc8ef5b009383'

packages/neuron-wallet/package.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"productName": "Neuron",
44
"description": "CKB Neuron Wallet",
55
"homepage": "https://www.nervos.org/",
6-
"version": "0.110.3",
6+
"version": "0.111.0",
77
"private": true,
88
"author": {
99
"name": "Nervos Core Dev",
@@ -42,17 +42,16 @@
4242
]
4343
},
4444
"dependencies": {
45-
"@ckb-lumos/base": "0.20.0-alpha.3",
46-
"@ckb-lumos/bi": "0.20.0-alpha.3",
47-
"@ckb-lumos/ckb-indexer": "0.20.0-alpha.3",
48-
"@ckb-lumos/codec": "0.20.0-alpha.3",
49-
"@ckb-lumos/config-manager": "0.20.0-alpha.3",
50-
"@ckb-lumos/hd": "0.20.0-alpha.3",
51-
"@ckb-lumos/helpers": "0.20.0-alpha.3",
52-
"@ckb-lumos/rpc": "0.20.0-alpha.3",
45+
"@ckb-lumos/base": "^0.21.0-next.1",
46+
"@ckb-lumos/bi": "^0.21.0-next.1",
47+
"@ckb-lumos/ckb-indexer": "^0.21.0-next.1",
48+
"@ckb-lumos/codec": "^0.21.0-next.1",
49+
"@ckb-lumos/config-manager": "^0.21.0-next.1",
50+
"@ckb-lumos/hd": "^0.21.0-next.1",
51+
"@ckb-lumos/helpers": "^0.21.0-next.1",
52+
"@ckb-lumos/rpc": "^0.21.0-next.1",
5353
"@iarna/toml": "2.2.5",
5454
"@ledgerhq/hw-transport-node-hid": "6.27.16",
55-
"@nervosnetwork/ckb-sdk-core": "0.109.0",
5655
"archiver": "5.3.0",
5756
"async": "3.2.4",
5857
"bn.js": "4.12.0",
@@ -96,7 +95,7 @@
9695
"electron-builder": "23.6.0",
9796
"electron-devtools-installer": "3.2.0",
9897
"jest-when": "3.5.2",
99-
"neuron-ui": "0.110.3",
98+
"neuron-ui": "0.111.0",
10099
"typescript": "5.0.4"
101100
}
102101
}

packages/neuron-wallet/src/block-sync-renderer/sync/queue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export default class Queue {
146146
const headers = await rpc
147147
.createBatchRequest<'getHeader', string[], CKBComponents.BlockHeader[]>(blockHashes.map(v => ['getHeader', v]))
148148
.exec()
149-
headers.forEach((blockHeader, idx) => {
149+
headers.forEach((blockHeader: CKBComponents.BlockHeader, idx: number) => {
150150
if (blockHeader) {
151151
const header = BlockHeader.fromSDK(blockHeader)
152152
txs[idx].timestamp = header.timestamp

packages/neuron-wallet/src/controllers/offline-sign.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export default class OfflineSignController {
4040
const rpc = generateRPC(NodeService.getInstance().nodeUrl)
4141

4242
if (context === undefined) {
43-
const rawTx = rpc.paramsFormatter.toRawTransaction(tx.toSDKRawTransaction())
43+
const rawSdkTx = tx.toSDKRawTransaction()
44+
const rawTx = rpc.paramsFormatter.toRawTransaction(rawSdkTx)
4445
const txs = await Promise.all(rawTx.inputs.map(i => rpc.getTransaction(i.previous_output!.tx_hash)))
4546
context = txs.map(i => rpc.paramsFormatter.toRawTransaction(i.transaction))
4647
}

packages/neuron-wallet/src/models/chain/block.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ export default class Block {
1414
const header = BlockHeader.fromSDK(block.header)
1515
return new Block(
1616
header,
17-
block.transactions.map(tx => Transaction.fromSDK(tx, header))
17+
block.transactions.map((tx: CKBComponents.RawTransaction | CKBComponents.Transaction) =>
18+
Transaction.fromSDK(tx, header)
19+
)
1820
)
1921
}
2022
}

packages/neuron-wallet/src/models/chain/transaction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export default class Transaction {
298298
blockHeader?: BlockHeader
299299
): Transaction {
300300
const txHash: string | undefined = (tx as CKBComponents.Transaction).hash
301-
const outputs = tx.outputs.map((o, i) => {
301+
const outputs = tx.outputs.map((o: CKBComponents.CellOutput, i: number) => {
302302
const output = Output.fromSDK(o)
303303
if (txHash) {
304304
output.setOutPoint(new OutPoint(txHash, i.toString()))
@@ -307,9 +307,9 @@ export default class Transaction {
307307
})
308308
return new Transaction(
309309
tx.version,
310-
tx.cellDeps.map(cd => CellDep.fromSDK(cd)),
310+
tx.cellDeps.map((cd: CKBComponents.CellDep) => CellDep.fromSDK(cd)),
311311
tx.headerDeps,
312-
tx.inputs.map(i => Input.fromSDK(i)),
312+
tx.inputs.map((i: CKBComponents.CellInput) => Input.fromSDK(i)),
313313
outputs,
314314
tx.outputsData,
315315
tx.witnesses,

packages/neuron-wallet/src/services/node.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ class NodeService {
155155
}
156156

157157
public async verifyExternalCkbNode() {
158+
logger.info('CKB:\tstart verify external ckb node')
158159
const network = NetworksService.getInstance().getCurrent()
159160
if (this._isCkbNodeExternal && network.type !== NetworkType.Light) {
160161
const localNodeInfo = await new RpcService(network.remote).localNodeInfo()

packages/neuron-wallet/src/services/sdk-core.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import CKB from '@nervosnetwork/ckb-sdk-core'
1+
import { CKBRPC } from '@ckb-lumos/rpc'
22
import https from 'https'
33
import http from 'http'
44

@@ -19,14 +19,14 @@ const getHttpAgent = () => {
1919
return httpAgent
2020
}
2121

22-
export const generateCKB = (url: string): CKB => {
23-
const ckb = new CKB(url)
22+
export const generateCKB = (url: string): CKBRPC => {
23+
const rpc = new CKBRPC(url)
2424
if (url.startsWith('https')) {
25-
ckb.rpc.setNode({ url, httpsAgent: getHttpsAgent() })
25+
rpc.setNode({ url, httpsAgent: getHttpsAgent() })
2626
} else {
27-
ckb.rpc.setNode({ url, httpAgent: getHttpAgent() })
27+
rpc.setNode({ url, httpAgent: getHttpAgent() })
2828
}
29-
return ckb
29+
return rpc
3030
}
3131

3232
export default {

packages/neuron-wallet/src/services/transaction-sender.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import signWitnesses from '@nervosnetwork/ckb-sdk-core/lib/signWitnesses'
21
import NodeService from './node'
32
import { serializeWitnessArgs } from '../utils/serialization'
43
import { scriptToAddress } from '../utils/scriptAndAddress'
@@ -21,6 +20,7 @@ import Script from '../models/chain/script'
2120
import Multisig from '../models/multisig'
2221
import Blake2b from '../models/blake2b'
2322
import logger from '../utils/logger'
23+
import { signWitnesses } from '../utils/signWitnesses'
2424
import { bytes as byteUtils, bytes, number } from '@ckb-lumos/codec'
2525
import SystemScriptInfo from '../models/system-script-info'
2626
import AddressParser from '../models/address-parser'
@@ -42,7 +42,7 @@ import { getMultisigStatus } from '../utils/multisig'
4242
import { SignStatus } from '../models/offline-sign'
4343
import NetworksService from './networks'
4444
import { generateRPC } from '../utils/ckb-rpc'
45-
import CKB from '@nervosnetwork/ckb-sdk-core'
45+
import { CKBRPC } from '@ckb-lumos/rpc'
4646
import CellsService from './cells'
4747
import hd from '@ckb-lumos/hd'
4848

@@ -216,7 +216,8 @@ export default class TransactionSender {
216216
wit.lock = serializedMultisig + wit.lock!.slice(2)
217217
signed[0] = serializeWitnessArgs(wit.toSDK())
218218
} else {
219-
signed = signWitnesses(privateKey)({
219+
signed = signWitnesses({
220+
privateKey,
220221
transactionHash: txHash,
221222
witnesses: serializedWitnesses.map(wit => {
222223
if (typeof wit === 'string') {
@@ -791,9 +792,8 @@ export default class TransactionSender {
791792
depositOutPoint: OutPoint,
792793
withdrawBlockHash: string
793794
): Promise<bigint> => {
794-
const ckb = new CKB(NodeService.getInstance().nodeUrl)
795+
const ckb = new CKBRPC(NodeService.getInstance().nodeUrl)
795796
const result = await ckb.calculateDaoMaximumWithdraw(depositOutPoint.toSDK(), withdrawBlockHash)
796-
797797
return BigInt(result)
798798
}
799799

packages/neuron-wallet/src/services/tx/transaction-service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getConnection } from 'typeorm'
2-
import CKB from '@nervosnetwork/ckb-sdk-core'
2+
import { CKBRPC } from '@ckb-lumos/rpc'
33
import TransactionEntity from '../../database/chain/entities/transaction'
44
import OutputEntity from '../../database/chain/entities/output'
55
import Transaction, {
@@ -507,14 +507,14 @@ export class TransactionsService {
507507
const inputTxHashes = inputs.map(v => v.previousOutput?.txHash).filter((v): v is string => !!v)
508508
if (!inputTxHashes.length) return inputs
509509
const url: string = NetworksService.getInstance().getCurrent().remote
510-
const ckb = new CKB(url)
511-
const inputTxs = await ckb.rpc
510+
const ckb = new CKBRPC(url)
511+
const inputTxs = await ckb
512512
.createBatchRequest<'getTransaction', string[], CKBComponents.TransactionWithStatus[]>(
513513
inputTxHashes.map(v => ['getTransaction', v])
514514
)
515515
.exec()
516516
const inputTxMap = new Map<string, CKBComponents.Transaction>()
517-
inputTxs.forEach((v, idx) => {
517+
inputTxs.forEach((v: { transaction: CKBComponents.Transaction }, idx: number) => {
518518
inputTxMap.set(inputTxHashes[idx], v.transaction)
519519
})
520520
return inputs.map(v => {

0 commit comments

Comments
 (0)