duniter issueshttps://git.duniter.org/nodes/typescript/duniter/-/issues2023-06-16T12:41:50+02:00https://git.duniter.org/nodes/typescript/duniter/-/issues/1449Unit tests : SqlLite connection not well closed2023-06-16T12:41:50+02:00Benoit LavenierUnit tests : SqlLite connection not well closedWhen trying to upgrade `mocha`, i found that DB connection are not well closed, because of write queries, that are asynchronous (see `SqliteNodeIOManager.writePromise`).
Inside `SqliteNodeIOManager.close()`, we wait the end of writing q...When trying to upgrade `mocha`, i found that DB connection are not well closed, because of write queries, that are asynchronous (see `SqliteNodeIOManager.writePromise`).
Inside `SqliteNodeIOManager.close()`, we wait the end of writing queries (add an `await this.writePromise;`1.8.7https://git.duniter.org/nodes/typescript/duniter/-/issues/1447Reverting a block will never trim LevelDBSindex.indexForTrimming2023-06-11T10:45:07+02:00Benoit LavenierReverting a block will never trim LevelDBSindex.indexForTrimmingIn [`LevelDBSindex.removeBlock()`](https://git.duniter.org/nodes/typescript/duniter/-/blob/dev/app/lib/dal/indexDAL/leveldb/LevelDBSindex.ts#L313) the function `trimWrittenOn()` is supposed to clean entries of the index `indexForTrimming...In [`LevelDBSindex.removeBlock()`](https://git.duniter.org/nodes/typescript/duniter/-/blob/dev/app/lib/dal/indexDAL/leveldb/LevelDBSindex.ts#L313) the function `trimWrittenOn()` is supposed to clean entries of the index `indexForTrimming` but instead indexForConditions is used :
```
private async trimWrittenOn(writtenOn: number, id: string) {
const k = LevelDBSindex.trimWrittenOnKey(writtenOn);
const existing = await this.getWrittenOnSourceIds(writtenOn);
const trimmed = arrayPruneAllCopy(existing, id);
if (trimmed.length) {
await this.indexForConditionsput(k, trimmed); // <= SHOULD BE indexForTrimming
} else {
await this.indexForConditions.del(k); // <= SHOULD BE indexForTrimming
}
}
```Cédric MoreauCédric Moreauhttps://git.duniter.org/nodes/typescript/duniter/-/issues/1446Reverting a block that consumed a source can delete the source, in SINDEX sub...2023-06-12T12:56:27+02:00Benoit LavenierReverting a block that consumed a source can delete the source, in SINDEX sub-index (indexForConditions)This unit test failed "revert b#3-4 and re-commit block#3 should be ok"
Cause:
- In [`LevelDBSindex.removeBlock()`](https://git.duniter.org/nodes/typescript/duniter/-/blob/dev/app/lib/dal/indexDAL/leveldb/LevelDBSindex.ts#L313) (for re...This unit test failed "revert b#3-4 and re-commit block#3 should be ok"
Cause:
- In [`LevelDBSindex.removeBlock()`](https://git.duniter.org/nodes/typescript/duniter/-/blob/dev/app/lib/dal/indexDAL/leveldb/LevelDBSindex.ts#L313) (for reverting a block), we call `trimConditions()` when a consumption is undone (when the `UPDATE` record should be deleted) even if a source creation exists.
Solution:
- The correct approach would be to call `trimConditions()` only when no source creation exists anymore.Cédric MoreauCédric Moreauhttps://git.duniter.org/nodes/typescript/duniter/-/issues/1445Synchronize on BMAS enpoint with a path (e.g. `/bma`)2023-06-06T18:02:11+02:00Benoit LavenierSynchronize on BMAS enpoint with a path (e.g. `/bma`)Yunohost Duniter package deploy BMAS on path `/bma`. Such endpoints seems to be not used by `sync` commandYunohost Duniter package deploy BMAS on path `/bma`. Such endpoints seems to be not used by `sync` commandhttps://git.duniter.org/nodes/typescript/duniter/-/issues/1444SqliteTable: all columns indexed ?2023-06-16T12:38:35+02:00Benoit LavenierSqliteTable: all columns indexed ?En regardant de plus près les index qui existent sur les tables, je m’aperçois que **toutes les colonnes sont indexées**. Par exemple dans le cas de la table des TX, cela fait beaucoup de monde ! :)
Voici [le code responsable](https://...En regardant de plus près les index qui existent sur les tables, je m’aperçois que **toutes les colonnes sont indexées**. Par exemple dans le cas de la table des TX, cela fait beaucoup de monde ! :)
Voici [le code responsable](https://git.duniter.org/nodes/typescript/duniter/-/blob/release/1.8/app/lib/dal/indexDAL/sqlite/SqliteTable.ts#L63) à mon avis :
```typescript
generateCreateIndexes() {
return this.keys()
.map((fieldName) => {
return `CREATE INDEX IF NOT EXISTS idx_${this.name}_${fieldName} ON ${this.name} (${fieldName});\n`;
})
.join("");
}
keys(): (keyof T)[] {
return Underscore.keys(this.fields);
}
```
Il s'agit d'un vieux code. Mais cela doit ralentir de beaucoup l'écriture dans la table, non ? D'autant que tout indexés semble inutile.
Par ailleurs je vois dans le constructeur que l'on a pour chaque colonne un `SqlFieldDefinition` avec un boolean `indexed`. Le but initial était sans doute d'utiliser cette valeur pour savoir quelle colonne indexées ou pas.
Je me trompes @cgeek ? Redis moi stp, si tu te penses que ca peut-être utile que j'optimise des choses de ce côté là aussi.
La correction semble toute simple, mais globalement il faudra retester une synchro pour voir si ca change quelque chose.1.8.7https://git.duniter.org/nodes/typescript/duniter/-/issues/1442Improve BMA `/tx/history/:pubkey/pending`, `/tx/history/:pubkey/blocks/:from/...2023-06-16T12:39:10+02:00Benoit LavenierImprove BMA `/tx/history/:pubkey/pending`, `/tx/history/:pubkey/blocks/:from/:to` and `/tx/history/:pubkey/times/:from/:to`I thhink we cn optimize the response time of BMA `/tx/history/:pubkey/pending`
In Duniter `dev` branch, i can see that:
- in `transactions.ts` the pubkey's full history is laoded (including sending and received), then filtered :
```ts...I thhink we cn optimize the response time of BMA `/tx/history/:pubkey/pending`
In Duniter `dev` branch, i can see that:
- in `transactions.ts` the pubkey's full history is laoded (including sending and received), then filtered :
```ts
async getPendingForPubkey(req: any): Promise<HttpTxHistory> {
const pubkey = await ParametersService.getPubkeyP(req);
return this.getFilteredHistory(pubkey, function (res: any) {
const histo = res.history;
Underscore.extend(histo, { sent: [], received: [] });
return res;
});
}
private async getFilteredHistory(
pubkey: string,
filter: any
): Promise<HttpTxHistory> {
let history = await this.server.dal.getTransactionsHistory(pubkey);
let result = {
currency: this.conf.currency,
pubkey: pubkey,
history: {
sending: history.sending.map(dbtx2HttpTxOfHistory),
received: history.received.map(dbtx2HttpTxOfHistory),
sent: history.sent.map(dbtx2HttpTxOfHistory),
pending: history.pending.map(dbtx2HttpTxOfHistory),
},
};
return filter(result);
}
}
```
- there is not DAL function to get only pending TX, by pubkey1.8.7https://git.duniter.org/nodes/typescript/duniter/-/issues/1441BMA /node/summary : dump config's storage2023-06-16T12:38:48+02:00Benoit LavenierBMA /node/summary : dump config's storageAdd storage infos into `/node/summary`.
New `/node/sumary` response should be :
```json
{
"duniter": {
"software": "duniter",
"version": "1.8.7",
"forkWindowSize": 100,
"storage": {
"transaction": true,
"w...Add storage infos into `/node/summary`.
New `/node/sumary` response should be :
```json
{
"duniter": {
"software": "duniter",
"version": "1.8.7",
"forkWindowSize": 100,
"storage": {
"transaction": true,
"wotwizard": false
}
}
}
```1.8.7Benoit LavenierBenoit Lavenierhttps://git.duniter.org/nodes/typescript/duniter/-/issues/1437GVA: bug with some membres or past members balances2023-03-21T00:23:50+01:00pokaGVA: bug with some membres or past members balancesThis is the related thread: https://forum.duniter.org/t/bug-balance-db-gva/9805
Some membre wallets or past members have a negative balance..
We can see it easily on this page, when order by balance (Solde Ğ1 column): https://g1-stats....This is the related thread: https://forum.duniter.org/t/bug-balance-db-gva/9805
Some membre wallets or past members have a negative balance..
We can see it easily on this page, when order by balance (Solde Ğ1 column): https://g1-stats.axiom-team.fr/data/search.htmlhttps://git.duniter.org/nodes/typescript/duniter/-/issues/1436[wiki] missing images in wiki on installation section2022-11-22T19:34:47+01:00Antonio Vanegas[wiki] missing images in wiki on installation section## Overview
Hi, I'm new, but I want try to contribute with Ğ1. Also I want improve my Rust skills or Android skills with this project, and of course try to expand this initiative. For now I found that the images on the server installati...## Overview
Hi, I'm new, but I want try to contribute with Ğ1. Also I want improve my Rust skills or Android skills with this project, and of course try to expand this initiative. For now I found that the images on the server installation guide are missing:
![screenshot20221122_192937](/uploads/b3423d57dfe5d417c6eb7b0247c45a79/screenshot20221122_192937.jpg)https://git.duniter.org/nodes/typescript/duniter/-/issues/1435En fonction du nœud la demande pour être membre visible ou pas2022-09-12T20:58:14+02:00L'AfricainEn fonction du nœud la demande pour être membre visible ou pasBonjour,
D'avance je m'excuse si je ne suis pas au bon endroit, mais vous me le signalerez.
j'aide une personne à devenir membre. On a passé son compte en demande pour être membre. 6 personnes l'ont certifié. Mais si je suis sur le nœud...Bonjour,
D'avance je m'excuse si je ne suis pas au bon endroit, mais vous me le signalerez.
j'aide une personne à devenir membre. On a passé son compte en demande pour être membre. 6 personnes l'ont certifié. Mais si je suis sur le nœud gi.duniter.org on me dit qu'aucune demande pour être membre n'a été faite. Si je change de nœud il est bien reconnu comme demandeur. Faut-il refaire une demande? Va-t-il perdre ses certifications?
![chezmoi](/uploads/4c7d8ef608141de106574503f558da83/chezmoi.png)
![pasdedemandes](/uploads/f489db45244fed4a1c1a47ed63651388/pasdedemandes.png)https://git.duniter.org/nodes/typescript/duniter/-/issues/1434Error `ruleNumber`2022-08-22T11:12:53+02:00Cédric MoreauError `ruleNumber`Duniter nodes are easily stuck in a fork when the frequency of forks increase.
The logs show `Error: ruleNumber`:
```
2022-08-18T20:40:11+02:00 - e[32minfoe[39m: Block resolution: 1 potential blocks after current#551678...
2022-08-18T2...Duniter nodes are easily stuck in a fork when the frequency of forks increase.
The logs show `Error: ruleNumber`:
```
2022-08-18T20:40:11+02:00 - e[32minfoe[39m: Block resolution: 1 potential blocks after current#551678...
2022-08-18T20:40:11+02:00 - e[31merrore[39m: Error: ruleNumber
at Function.checkBlock (/opt/duniter/app/lib/blockchain/DuniterBlockchain.js:63:19)
at process._tickCallback (internal/process/next_tick.js:68:7)
```
Along with `NotFoundError: Key not found in database`:
```
2022-08-18T16:05:37+02:00 - �[32minfo�[39m: Block #551677 added to the blockchain in 246 ms
2022-08-18T16:05:39+02:00 - �[32minfo�[39m: Block #551677 added to the blockchain in 253 ms
2022-08-18T16:05:39+02:00 - �[32minfo�[39m: Block #551678 added to the blockchain in 70 ms
2022-08-18T16:05:39+02:00 - �[31merror�[39m: Unhandled rejection: NotFoundError: Key not found in database [1660828921]
2022-08-18T16:05:39+02:00 - �[31merror�[39m: NotFoundError: Key not found in database [1660828921]
at /opt/duniter/node_modules/levelup/lib/levelup.js:192:15
```
Actually, the `ruleNumber` error is a symptom of the `Key not found in database` error, which is a low level issue in the data access layer. A LevelDB key has been deleted whereas it is supposed to still exist.Cédric MoreauCédric Moreauhttps://git.duniter.org/nodes/typescript/duniter/-/issues/1423WS2P UPnP: start port lookup at less than 209002020-12-03T13:29:00+01:00Cédric MoreauWS2P UPnP: start port lookup at less than 20900I recently moved my home, and my Freebox IP changed. By default in such situation, Free gives you a brand new IP configuration and by default a dynamic one. In such case, the range of available ports is [1;16383].
But as Duniter starts ...I recently moved my home, and my Freebox IP changed. By default in such situation, Free gives you a brand new IP configuration and by default a dynamic one. In such case, the range of available ports is [1;16383].
But as Duniter starts its lookup at 20900, the UPnP port opening just fails. Always.
Maybe we could start the lookup at a lower range, like 10900? (keeping the "900" thing) I don't know if other users have constraints too that we should take into account as well making 10900 a wrong start.https://git.duniter.org/nodes/typescript/duniter/-/issues/1422duniter 1.8.0 always stops after a few time on raspberry Pi2021-05-10T19:57:37+02:00Benoît Rouitsduniter 1.8.0 always stops after a few time on raspberry PiHello. On a Raspberry Pi 4GB, Duniter 1.8.0 always stops after a few time running (say one or two days). I have to restart it manually almost every day. I don't see any logs generated by duniter for help. BTW previous duniter version was...Hello. On a Raspberry Pi 4GB, Duniter 1.8.0 always stops after a few time running (say one or two days). I have to restart it manually almost every day. I don't see any logs generated by duniter for help. BTW previous duniter version was working without problem. Tell me how can I help to troubleshoot that issue.https://git.duniter.org/nodes/typescript/duniter/-/issues/1421Upgrade to a newest Node.js version before Node.js v10 maintenance get dropped2023-06-09T11:11:28+02:00MoulUpgrade to a newest Node.js version before Node.js v10 maintenance get droppedDuniter is currently using Node.js v10.
This version is the last release in maintenance state before being dropped, as planned, on April 30th of 2021.
I am not sure how long would Node.js and TS/JS code would still live in Duniter, but u...Duniter is currently using Node.js v10.
This version is the last release in maintenance state before being dropped, as planned, on April 30th of 2021.
I am not sure how long would Node.js and TS/JS code would still live in Duniter, but updating Node.js version would allow to get security fixes from Node.js side.
https://nodejs.org/en/about/releases/2.0https://git.duniter.org/nodes/typescript/duniter/-/issues/1419Migrer les fichiers keyring.yml existant en 6402020-10-04T18:22:06+02:00ÉloïsMigrer les fichiers keyring.yml existant en 640A faire en Rust quand cette partie sera migrée car pas réussi en NodeJs, voir #1416A faire en Rust quand cette partie sera migrée car pas réussi en NodeJs, voir #14162.0https://git.duniter.org/nodes/typescript/duniter/-/issues/1417import-lookup et crawl-lookup devraient transférer les documents de révocation2020-07-23T11:24:27+02:00matograineimport-lookup et crawl-lookup devraient transférer les documents de révocationLes fonctions import-lookup et crawl-lookup ne transmettent que les documents d'entrée dans la WoT. Il me semble tout aussi essentiel de transmettre les documents de révocation.Les fonctions import-lookup et crawl-lookup ne transmettent que les documents d'entrée dans la WoT. Il me semble tout aussi essentiel de transmettre les documents de révocation.https://git.duniter.org/nodes/typescript/duniter/-/issues/1415gen-root requires undocumented --submit-local or (--submit-host and --submit-...2020-07-06T11:35:44+02:00Santiagogen-root requires undocumented --submit-local or (--submit-host and --submit-port) arguments`gen-root` calls `generateAndSend()`:
https://git.duniter.org/nodes/typescript/duniter/-/blob/v1.8.1/app/modules/prover/index.ts#L184
that checks if there is a submit host option passed along with the command:
https://git.duniter.org/n...`gen-root` calls `generateAndSend()`:
https://git.duniter.org/nodes/typescript/duniter/-/blob/v1.8.1/app/modules/prover/index.ts#L184
that checks if there is a submit host option passed along with the command:
https://git.duniter.org/nodes/typescript/duniter/-/blob/v1.8.1/app/modules/prover/index.ts#L248
however, this seems undocumented, at least `--help` doesn't describes this.https://git.duniter.org/nodes/typescript/duniter/-/issues/1399Champ `monetaryMass` incorrect sur certains blocs2020-05-10T16:03:49+02:00Cédric MoreauChamp `monetaryMass` incorrect sur certains blocsVoir https://forum.duniter.org/t/bug-de-masse-monetaire-duniter-1-7/7141Voir https://forum.duniter.org/t/bug-de-masse-monetaire-duniter-1-7/71411.10https://git.duniter.org/nodes/typescript/duniter/-/issues/1398Paramètre ` onlyPeers` ne fonctionne plus2023-09-19T15:32:34+02:00insoParamètre ` onlyPeers` ne fonctionne plusSuite à la synchro de mon noeud, il se retrouve isolé. Les quelques pairs qu'il a récupéré timeout. je souhaitais ne synchroniser que les pairs pour aller plus vite, mais la commande échoue :
```
g1@yunohost:/opt/scripts-for-duniter# ...Suite à la synchro de mon noeud, il se retrouve isolé. Les quelques pairs qu'il a récupéré timeout. je souhaitais ne synchroniser que les pairs pour aller plus vite, mais la commande échoue :
```
g1@yunohost:/opt/scripts-for-duniter# duniter sync duniter.acostey.fr --onlypeers --nointeractive
2020-04-05T07:14:56+02:00 - debug: Plugging file system...
2020-04-05T07:14:56+02:00 - debug: Loading conf...
2020-04-05T07:14:56+02:00 - debug: Configuration saved.
Failed to open file for reading : /opt/g1/.config/duniter/duniter_default/wotb.bin
2020-04-05T07:14:56+02:00 - debug: Opening SQLite database "/opt/g1/.config/duniter/duniter_default/duniter.db"...
2020-04-05T07:14:57+02:00 - debug: Opening SQLite database "/opt/g1/.config/duniter/duniter_default/txs.db"...
2020-04-05T07:14:57+02:00 - debug: Opening SQLite database "/opt/g1/.config/duniter/duniter_default/peers.db"...
2020-04-05T07:14:59+02:00 - debug: Upgrade database...
2020-04-05T07:15:06+02:00 - info: Block resolution: 0 potential blocks for root block...
2020-04-05T07:15:06+02:00 - debug: Closing LevelDB level_blockchain...
2020-04-05T07:15:06+02:00 - debug: Closing LevelDB level_wallet...
2020-04-05T07:15:06+02:00 - debug: Closing LevelDB level_bindex...
2020-04-05T07:15:06+02:00 - debug: Closing LevelDB level_mindex...
2020-04-05T07:15:06+02:00 - debug: Closing LevelDB level_iindex...
2020-04-05T07:15:06+02:00 - debug: Closing LevelDB level_sindex...
2020-04-05T07:15:06+02:00 - debug: Closing LevelDB level_cindex...
2020-04-05T07:15:06+02:00 - debug: Closing LevelDB level_dividend...
2020-04-05T07:15:06+02:00 - debug: Trying to close SQLite...
2020-04-05T07:15:06+02:00 - debug: Trying to close SQLite...
2020-04-05T07:15:06+02:00 - error: TypeError: Cannot read property 'getPeers' of undefined
at RemoteSynchronizer.syncPeers (/opt/duniter/app/modules/crawler/lib/sync/RemoteSynchronizer.js:258:39)
at Object.onDatabaseExecute (/opt/duniter/app/modules/crawler/index.js:130:41)
at Stack.processCommand (/opt/duniter/index.js:380:47)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)
```https://git.duniter.org/nodes/typescript/duniter/-/issues/1397Some Transactions with complex lock conditions not appear in sources list2020-04-03T15:28:55+02:00Vincent TexierSome Transactions with complex lock conditions not appear in sources list- currency: g1-test
- version: Duniter 1.7.21
Some transaction with complex conditions do not appear in sources.
**It seems to be linked to the amount !
It's like the BR_G106 was setting a minimum of 100 base 2 amount for a transactio...- currency: g1-test
- version: Duniter 1.7.21
Some transaction with complex conditions do not appear in sources.
**It seems to be linked to the amount !
It's like the BR_G106 was setting a minimum of 100 base 2 amount for a transaction to appear in sources...**
I have sent a transaction with this condition:
```
4AC3D784EFA9A004CE9D4CE759CE320A0AE30EF5DAE7921DB7CB0658A45F5423
"100:2:SIG(AhRMHUxMPXSeG7qXZrE6qCdjwK9p2bu5Eqei7xAWVEDK) || (SIG(HAy1hLpHfqrG3xsZRoBVkNigGQZnDfJK2az5MeRYtyNb) && CSV(604800))"
```
It appeared in the sources list, and I spent it back to me after one week. Great!
Now I have sent 3 transactions.
**These two do not appear in the sources list!**
```
CC60CABF8991B7C5B742ED983D542C26E33D34EE725900BC591A846D2321ACA9
"1:2:SIG(AhRMHUxMPXSeG7qXZrE6qCdjwK9p2bu5Eqei7xAWVEDK) || (SIG(HAy1hLpHfqrG3xsZRoBVkNigGQZnDfJK2az5MeRYtyNb) && CSV(604800))"
8C6E1FCC46A9681CA589873B97B39BF1262F0E22398F58770B0EBE21B4253C6C
"2:2:SIG(AhRMHUxMPXSeG7qXZrE6qCdjwK9p2bu5Eqei7xAWVEDK) || (SIG(HAy1hLpHfqrG3xsZRoBVkNigGQZnDfJK2az5MeRYtyNb) && CSV(604800))"
```
This last one, with 100 gt again appear in sources as expected:
```
7599978B998E44790913BC67743022122E58282991923B93491FC297F3CD92B5
"100:2:SIG(AhRMHUxMPXSeG7qXZrE6qCdjwK9p2bu5Eqei7xAWVEDK) || (SIG(HAy1hLpHfqrG3xsZRoBVkNigGQZnDfJK2az5MeRYtyNb) && CSV(604800))"
```