nodes issueshttps://git.duniter.org/groups/nodes/-/issues2024-03-21T11:24:52+01:00https://git.duniter.org/nodes/rust/duniter-v2s/-/issues/222Compilation error with try-runtime feature2024-03-21T11:24:52+01:00Benjamin GalloisCompilation error with try-runtime featureRuntime not compiling with the `try-runtime` feature:
- Implementation is not up-to-date.
- Downstream error occurs where `try-runtime` requires traits implemented only with `runtime-benchmarks`.
- Deprecation: `use of deprecated method ...Runtime not compiling with the `try-runtime` feature:
- Implementation is not up-to-date.
- Downstream error occurs where `try-runtime` requires traits implemented only with `runtime-benchmarks`.
- Deprecation: `use of deprecated method `try_runtime_cli::TryRuntimeCmd::run`: Substrate's `try-runtime` subcommand has been migrated to a standalone CLI (https://github.com/paritytech/try-runtime-cli). It is no longer being maintained here and will be removed entirely some time after January 2024. Please remove this subcommand from your runtime and use the standalone CLI.`Benjamin GalloisBenjamin Galloishttps://git.duniter.org/nodes/rust/duniter-v2s/-/issues/220Smith-members: invert `issuer` and `receiver` in events2024-03-21T11:25:19+01:00Cédric MoreauSmith-members: invert `issuer` and `receiver` in eventsruntime-802Benjamin GalloisBenjamin Galloishttps://git.duniter.org/nodes/rust/duniter-v2s/-/issues/219Distance : rajouter le résultat dans l'évènement2024-03-21T11:25:19+01:00Cédric MoreauDistance : rajouter le résultat dans l'évènementActuellement les évènements _`EvaluatedValid` et `EvaluatedInvalid`_ n'ont que l' `idty_index` comme métadonnée.Actuellement les évènements _`EvaluatedValid` et `EvaluatedInvalid`_ n'ont que l' `idty_index` comme métadonnée.runtime-802Benjamin GalloisBenjamin Galloishttps://git.duniter.org/nodes/rust/duniter-v2s/-/issues/216Reduce code duplication for runtime features2024-03-21T00:00:57+01:00Hugo TrentesauxReduce code duplication for runtime featuresA lot of code duplication happens in node definition like:
```rust
// with features {gdev, gtest, g1}
g1_runtime::RuntimeApi, g1_executor::G1Executor
```
Most of them could be refactored using imports, some would need basic macro, and ...A lot of code duplication happens in node definition like:
```rust
// with features {gdev, gtest, g1}
g1_runtime::RuntimeApi, g1_executor::G1Executor
```
Most of them could be refactored using imports, some would need basic macro, and this could make reading and editing this part of the code easier.Horizonhttps://git.duniter.org/nodes/rust/duniter-v2s/-/issues/215Document compilation features2024-03-21T11:24:51+01:00Hugo TrentesauxDocument compilation featuresWe have multiple compilation features that should be documented for new contributors.We have multiple compilation features that should be documented for new contributors.Horizonhttps://git.duniter.org/nodes/rust/duniter-v2s/-/issues/214Allow native Runtime execution2024-03-08T11:36:25+01:00Cédric MoreauAllow native Runtime executionSince !229, the `--execution native` CLI option is not effective anymore. This was planned both by [Polkadot](https://www.polkadot.network/blog/a-polkadot-postmortem-24-05-2021) and [our team](https://forum.duniter.org/t/exemple-de-bug-l...Since !229, the `--execution native` CLI option is not effective anymore. This was planned both by [Polkadot](https://www.polkadot.network/blog/a-polkadot-postmortem-24-05-2021) and [our team](https://forum.duniter.org/t/exemple-de-bug-lie-a-la-difference-entre-runtime-wasm-et-natif/11574/10?u=cgeek).
However, I feel a bit lost when I cannot put Breakpoints in the Runtime while developing: I use theme a lot both for understanding Runtime behavior and global Client code call stack. It is very effective for my global comprehension of Substrate code.
I understand why we removed this option. I suggest that we bring it back in another form: a Cargo _feature_ _flag_ allowing for its usage by developers:
```plaintext
cargo run --feature native
```runtime-802Cédric MoreauCédric Moreauhttps://git.duniter.org/nodes/rust/duniter-v2s/-/issues/207Distance oracle tries to publish inherent even if already published result, l...2024-03-06T18:56:08+01:00Hugo TrentesauxDistance oracle tries to publish inherent even if already published result, leading to ExtrinsicFailed result of the inherentDistance oracle tries to publish inherent even if already published result, leading to ExtrinsicFailed result of the inherent
for more details about the example: https://forum.duniter.org/t/oracle-de-distance-dans-un-docker/11706/10Distance oracle tries to publish inherent even if already published result, leading to ExtrinsicFailed result of the inherent
for more details about the example: https://forum.duniter.org/t/oracle-de-distance-dans-un-docker/11706/10runtime-802https://git.duniter.org/nodes/rust/duniter-v2s/-/issues/205use identity index as validator id2024-02-27T16:02:55+01:00Hugo Trentesauxuse identity index as validator id#197 is still #S-needdiscussion, but at least the "use identity index as validator id" can be done independently.#197 is still #S-needdiscussion, but at least the "use identity index as validator id" can be done independently.https://git.duniter.org/nodes/rust/duniter-v2s/-/issues/203Handlers simplification2024-03-20T23:02:17+01:00Benjamin GalloisHandlers simplification## Issue
Currently, the problem lies in having complicated handlers to follow, namely `OnEvent`. This handler has multiple paths hidden in several implementations, making it harder to read and account for weight. The `OnIdty` is on the ...## Issue
Currently, the problem lies in having complicated handlers to follow, namely `OnEvent`. This handler has multiple paths hidden in several implementations, making it harder to read and account for weight. The `OnIdty` is on the same model but with fewer paths.
## Current Design
Your implementation currently presents two designs for handlers:
1. A loosely coupled approach where the handler is implemented in the runtime, and there is no tight coupling between dependencies.
2. A tightly coupled approach where the handler is implemented inside one or more pallets, and dependencies are tightly coupled. These handlers are then assembled in a tuple handler, or in a (super) handler in the runtime that call these handlers.
At the moment, both approaches are used simultaneously, with `OnEvent` being implemented loosely in the runtime but also tightly inside the `wot` pallet ([source](https://git.duniter.org/nodes/rust/duniter-v2s/-/blob/master/runtime/common/src/pallets_config.rs?ref_type=heads#L502)).
## Solution
There are multiple solutions to the problem:
1. Splitting the `OnEvent` into smaller handlers, making them more comprehensible, following the model of `OnNewcert` and `OnRemovecert`.
2. Implementing all handlers in a single implementation in the runtime, avoiding tuple handlers. This will make the pallets more flexible, avoiding tight couplings, but it can be counterintuitive for pallets like `duniter-wot`, where there is already a tight coupling with several pallets.
## Note
In !246, Hugo mentioned decoupling the logic and the manual weight accounting that needs to be done for functions called in handlers and hooks. One way to achieve this is to separate the pallet into internal private functions with `()` or `DispatchResult` return type and public external functions with a `Weight` return type. I created a small POC crate where the weight can be autogenerated based on an expression or a function of the same argument signature, see example below. So, it is entirely possible to go this way with minimal work if the simplification mentioned above is not enough.
```rust
#[derive_weight(Weight::from_parts(10, 10))]
fn do_something(i: u32, j: u32) -> u32 {
i * j
}
assert_eq!(weighted_do_something(1, 2), Weight::from_parts(10, 10));
//
fn weight_for_do_something(i: u32, _j: u32) -> Weight {
if i == 0 {
Weight::from_parts(10, 10)
}
else {
Weight::from_parts(20, 20)
}
}
#[derive_weight(weight_for_do_something)]
fn do_something(i: u32, j: u32) -> u32 {
if i == 0 {
i + j
}
else {
i/j
}
}
assert_eq!(weighted_do_something(0, 2), Weight::from_parts(10, 10));
assert_eq!(weighted_do_something(10, 2), Weight::from_parts(20, 20));
//
#[derive_weight((Weight::zero(), Weight::from_parts(10, 10)))]
fn do_something(i: u32, j: u32) -> Result<(), ()> {
if i == 0 {
Ok(())
} else {
Err(())
}
}
assert_eq!(weighted_do_something(0), weight::from_parts(0, 0));
assert_eq!(weighted_do_something(1), weight::from_parts(10, 10));
```Horizonhttps://git.duniter.org/nodes/rust/duniter-v2s/-/issues/202align distance oracle on modulo instead of session2024-03-06T15:05:13+01:00Hugo Trentesauxalign distance oracle on modulo instead of sessionIn Duniter v1 the time for distance evaluation was 5 minutes. In Duniter v2 it's 2 hours. That's too much. And its also too strict because it is aligned on sessions which is cumbersome in development networks.
Quote from the forum:
htt...In Duniter v1 the time for distance evaluation was 5 minutes. In Duniter v2 it's 2 hours. That's too much. And its also too strict because it is aligned on sessions which is cumbersome in development networks.
Quote from the forum:
https://forum.duniter.org/t/distance/11672/16
[quote="HugoTrentesaux, post:16, topic:11672"]
[quote="tuxmain, post:6, topic:11672"]
On pourrait se synchroniser avec des numéros de blocs modulo N plutôt que des sessions, si besoin.
[/quote]
Ce serait pas mal de ramener ce temps d’évaluation à 5 minutes comme dans Duniter v1. Par contre il faudra trouver un remplaçant pour `on_new_session`. Ça pourrait être un `on_init` avec un modulo, tout simplement.
[/quote]
Linked to #174runtime-802Benjamin GalloisBenjamin Galloishttps://git.duniter.org/nodes/rust/duniter-v2s/-/issues/201distance oracle refuses "insecure url"2024-02-23T01:28:06+01:00Hugo Trentesauxdistance oracle refuses "insecure url"I tried to run indexer on a local docker network with ws:
```
docker compose logs -f
distance-oracle-distance-oracle-1 | thread 'main' panicked at /root/distance-oracle/src/api.rs:31:10:
distance-oracle-distance-oracle-1 | Cannot crea...I tried to run indexer on a local docker network with ws:
```
docker compose logs -f
distance-oracle-distance-oracle-1 | thread 'main' panicked at /root/distance-oracle/src/api.rs:31:10:
distance-oracle-distance-oracle-1 | Cannot create RPC client: Rpc(InsecureUrl("ws://duniter-smith:9944"))
distance-oracle-distance-oracle-1 | note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
distance-oracle-distance-oracle-1 | Waiting 1800 seconds before next execution...
```
How to allow "insecure url"?runtime-802Hugo TrentesauxHugo Trentesauxhttps://git.duniter.org/nodes/duniter-squid/-/issues/12Define @cardinality for every type in graphql.schema2024-02-28T13:24:56+01:00pokaDefine @cardinality for every type in graphql.schemaThis is required to be able to define `--max-response-size` option to `squid-graphql-server` command, to prevent DoS.
**Source: https://docs.subsquid.io/sdk/resources/graphql-server/dos-protection/**This is required to be able to define `--max-response-size` option to `squid-graphql-server` command, to prevent DoS.
**Source: https://docs.subsquid.io/sdk/resources/graphql-server/dos-protection/**https://git.duniter.org/nodes/duniter-squid/-/issues/9update transaction history for gdev8 and update doc accordingly2024-02-12T20:39:14+01:00Hugo Trentesauxupdate transaction history for gdev8 and update doc accordinglyHugo TrentesauxHugo Trentesauxhttps://git.duniter.org/nodes/rust/duniter-v2s/-/issues/199Docker distance entrypoint is outdated2024-02-15T16:29:33+01:00Hugo TrentesauxDocker distance entrypoint is outdatedcf https://forum.duniter.org/t/differentes-manieres-de-faire-tourner-loracle-de-distance/11990
After !226 the args changed but they were not updated in the entrypoint.cf https://forum.duniter.org/t/differentes-manieres-de-faire-tourner-loracle-de-distance/11990
After !226 the args changed but they were not updated in the entrypoint.runtime-801Hugo TrentesauxHugo Trentesauxhttps://git.duniter.org/nodes/rust/duniter-v2s/-/issues/198Pallet-identity `logic error`2024-02-13T20:25:39+01:00Benjamin GalloisPallet-identity `logic error`All the extrinsics calling `do_remove_identity` triggered the `Logic error: Account already dead when reducing provider` during the benchmark of the pallet identity with the runtime.All the extrinsics calling `do_remove_identity` triggered the `Logic error: Account already dead when reducing provider` during the benchmark of the pallet identity with the runtime.runtime-801Benjamin GalloisBenjamin Galloishttps://git.duniter.org/nodes/rust/duniter-v2s/-/issues/196Check that transfer_all on a linked account does not lead to empty linked acc...2024-03-06T15:23:57+01:00Hugo TrentesauxCheck that transfer_all on a linked account does not lead to empty linked accountNot sure which behavior we want to have but after #153 it would be better to simply unlink the account.Not sure which behavior we want to have but after #153 it would be better to simply unlink the account.runtime-802Benjamin GalloisBenjamin Galloishttps://git.duniter.org/nodes/duniter-squid/-/issues/8Missing documentation2024-02-08T14:52:43+01:00Cédric MoreauMissing documentationWhile installing my own Squid instance, I felt into few pits.
I will create an MR to fix these.While installing my own Squid instance, I felt into few pits.
I will create an MR to fix these.Cédric MoreauCédric Moreauhttps://git.duniter.org/nodes/rust/duniter-v2s/-/issues/194smith-members: SmithMembers.CurrentSession is not updated2024-02-15T16:26:10+01:00Cédric Moreausmith-members: SmithMembers.CurrentSession is not updatedSeen here: [https://forum.duniter.org/t/gcli-sadapte-au-runtime-800-nouveau-parcours-forgeron/11880/20](https://forum.duniter.org/t/gcli-sadapte-au-runtime-800-nouveau-parcours-forgeron/11880/20?u=cgeek)
Joss was promoted to Smith but i...Seen here: [https://forum.duniter.org/t/gcli-sadapte-au-runtime-800-nouveau-parcours-forgeron/11880/20](https://forum.duniter.org/t/gcli-sadapte-au-runtime-800-nouveau-parcours-forgeron/11880/20?u=cgeek)
Joss was promoted to Smith but its `expires_on` value is set to `336` which is the default delay (in number of sessions) as if current session was still `0`.
However current `Session.CurrentIndex` is `75`.
This is not consitent.runtime-801Benjamin GalloisBenjamin Galloishttps://git.duniter.org/nodes/rust/duniter-v2s/-/issues/193Compilation error `use of unstable library feature 'stdsimd'`2024-02-21T12:54:50+01:00Benjamin GalloisCompilation error `use of unstable library feature 'stdsimd'`There is a non-fixed version number in the https://github.com/ZcashFoundation/ed25519-zebra/blob/c39bd4364a03f4b8eb97c21b9aa6c9b357074280/Cargo.toml#L21 dependency that automatically updates curve25519-dalek from 4.1.1 to 4.1.2, introduc...There is a non-fixed version number in the https://github.com/ZcashFoundation/ed25519-zebra/blob/c39bd4364a03f4b8eb97c21b9aa6c9b357074280/Cargo.toml#L21 dependency that automatically updates curve25519-dalek from 4.1.1 to 4.1.2, introducing a breaking change (https://github.com/dalek-cryptography/curve25519-dalek/issues/622) where curve25519-dalek >= 4.1.2 will only work with the latest nightly to date, and polkadot-v1.6.0 will not work with the latest nightly. The `Cargo.lock` should not be regenerated until we fix the error upstream.runtime-801Benjamin GalloisBenjamin Galloishttps://git.duniter.org/nodes/duniter-squid/-/issues/7Create fake event for genesis to allow more uniform API2024-02-09T10:24:23+01:00Hugo TrentesauxCreate fake event for genesis to allow more uniform APISee thread https://git.duniter.org/nodes/duniter-squid/-/merge_requests/4#note_41224 of !4See thread https://git.duniter.org/nodes/duniter-squid/-/merge_requests/4#note_41224 of !4