Code Monkey home page Code Monkey logo

crunch's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

crunch's Issues

Subxt functions failing for Aleph Zero mainnet

Dear Paulo, I hope this case finds you well,

For your kind consideration, this is the issue we are facing with the mainnet of Aleph Zero, this network is implementing the runtime version aleph-node/46 and both, the local ws:// endpoint, and Crunch's metadata, are up to date with the appropriate versions.

The first symptom are shown in the logs as:

[WARN  crunch::runtimes::aleph_zero] Crunch upgrade might be required soon. Local static metadata differs from current chain runtime version.
[INFO  crunch::report] <details><summary>Next era expect <b>NO</b> rewards ๐Ÿ™</summary>

(apart of the WARN, please note the absence of the Earlier claimed comment in the INFO block.

After which the bot runs without apparent problems and even hooks OK with the paidEras() event, but it fails to retrieve the pending payments and process no payouts at all.

Thus, with the help of another community member, it was determined that at least two functions seem to be failing in the aleph_zero.rs file:

  • node_runtime::validate_codegen
  • node_runtime::storage().staking().history_depth(), and/or
  • crunch.client().clone().storage().fetch() for the above history_depth_addr

Do you have an idea were to start looking for a solution?

Please advise!

Best regards...

Milos

Fails to run in Ubuntu 22.04 LTS

Hello @paulormart !!

Due to Ubuntu 22.04 LTS migrating from OpenSSL 1.1 to 3.0, when trying to run the current release in those systems, it returns:

crunch: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

Greetings!

OpenSSL error, File not found

Starting from version 0.8.1 the following error is found
crunch: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory.
It seems like support for OpenSSL v1 which is the default in Debian

'async-std/runtime' panicked

Hi all, i am getting this error when trying to start up crunch. Any idea how i can resolve it? Many thanks

[2023-05-10T06:39:16Z WARN crunch::runtimes::kusama] Crunch upgrade might be required soon. Local static metadata differs from current chain runtime version.
thread 'async-std/runtime' panicked at 'constructed from known-good static value; qed: InvalidFormat', src/crunch.rs:134:10
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
thread 'main' panicked at 'task has failed', /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.3.0/src/task.rs:426:43

Subxt error: Metadata

Hi All,
Firstly thanks for building this amazing bot.

I am facing this issue on Kusama after runtime upgrade to 0.9.42. Any idea how I can retrieve and change the metadata to get the bot working again? :(

[2023-05-25T07:01:49Z WARN crunch::runtimes::kusama] Crunch upgrade might be required soon. Local static metadata differs from current chain runtime version.
[2023-05-25T07:01:50Z ERROR crunch::crunch] Subxt error: Metadata: Pallet System Storage System has incompatible metadata

Support docker/podman

Add Dockerfile for basic docker/podman support

(If accepted, I'll happily update README.md as well)

Build error: unresolved import `async_task::Builder`

Seems like a missing dependency. Using rust 1.74

```unresolved import async_task::Builder
--> /home/payment/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-executor-1.8.0/src/lib.rs:46:18
|
46 | use async_task::{Builder, Runnable};
| ^^^^^^^ no `Builder` in the root
|
= help: consider importing this struct instead:
std::thread::Builder

For more information about this error, try rustc --explain E0432.
error: could not compile async-executor (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Handle signals for clean exit

SIGINT and SIGTERM do not seem to cause crunch to exit cleanly. It would be nice to have a way to exit properly.

Example from running in podman

WARN[0010] StopSignal SIGTERM failed to stop container containercrunch in 10 seconds, resorting to SIGKILL 

libssl.so.1.1 library issue on Ubuntu 22.04.2 LTS

The service fails to start with "/crunch-bot/crunch: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory...". Why am I getting this error? how do I fix this?

I am using [Crunch v0.9.3]

Cheers!

Crunch suddenly doesn't work - Rpc error

I've been encountering this error lately:

INFO crunch::runtimes::kusama] Inspect and `crunch` unclaimed payout rewards
WARN crunch::runtimes::kusama] batch call indexes [0 : 2]
ERROR crunch::crunch] Subxt error: Rpc error: RPC error
INFOcrunch::crunch] Connected to Kusama network using ws://127.0.0.1:9944 * Substrate node Parity Polkadot v0.9.36-dc25abc712e
INFO crunch::matrix] The 'Crunch Bot' user @......t:matrix.org has been authenticated at matrix.org
INFO crunch::matrix] Messages will be sent to room #Y3J1bmNoL.............
INFOcrunch::runtimes::kusama] Inspect and `crunch` unclaimed payout rewards
WARN  crunch::runtimes::kusama] batch call indexes [0 : 2]
ERROR crunch::crunch] Subxt error: Rpc error: RPC error

Some discord member sugested to replace the RPC with
CRUNCH_SUBSTRATE_WS_URL=wss://ksm-rpc.stakeworld.io:443 which I did, but the error is still there and it is quite the same.

I was hoping that reinstalling the node will solve the issue so I reinstalled on a fresh Ubuntu. For some reason I decided to use 20.0.4 LTS, not 22.0.4 like I did before which seems to be a not very inspired choice: now I have another issue: the OpenSSL version is OpenSSL 1.1.1f which looks like it doesn't support crunch.
In the meantime I tried to upgrade my Openssl to 3.1.0, some errors occurred and I just gave up for now as it's Christmas Eve, lol.
I'll be back with a new report after OpenSSL will be upgraded to 3.1.0.

Validator reward daily flag not respected

I'm trying to pay out KSM rewards daily for multiple stash addresses. Despite the daily flag, the payout was triggered every era. After increasing the batch size to 100, the payments don't happen after 24 hours. What am I misunderstanding?

Sep 21 11:28:28 crunch[1174245]: [2022-09-21T11:28:28Z INFO  crunch::report] ๐Ÿ’ฏ Payout for era <del>4228</del> finalized at block #14547497
Sep 21 17:31:40 crunch[1312875]: [2022-09-21T17:31:40Z INFO  crunch::report] ๐Ÿ’ฏ Payout for era <del>4229</del> finalized at block #14551089
Sep 21 23:32:11 crunch[1312875]: [2022-09-21T23:32:11Z INFO  crunch::report] ๐Ÿ’ฏ Payout for era <del>4230</del> finalized at block #14554653

arguments:

ExecStart=/home/payment/crunch/target/release/crunch \
  --config-path /home/payment/stuffs/.env.kusama \
  --substrate-ws-url ws://127.0.0.1:9944 \
  rewards --short -f /home/payment/stuffs/.private_file \
 --disable-public-matrix-room \
 --disable-matrix daily

latest config

CRUNCH_SUBSTRATE_WS_URL=ws://127.0.0.1:9944
CRUNCH_MAXIMUM_PAYOUTS=84
CRUNCH_MAXIMUM_HISTORY_ERAS=84
CRUNCH_MAXIMUM_CALLS=100

Pool permissionless claiming

Hi, I thought crunchbot would claim pool nominees rewards as well as compound them based on the new permissionless claiming feature, but apparently all it does is claim rewards for the validator the pool is nominating.

Are there any plans for such functionality?

Screenshot 2023-07-04 at 17 53 07

Run the tool as systemd service

I try to run the tool as a systemd service, here is my try:

[Unit]
Description=Kusama Autopayout

[Service]
ExecStart=/home/tw/crunch-bot/crunch rewards --seed-path '/home/tw/crunch-bot/.private.seed' --disable-matrix
Restart=always
RestartSec=15

[Install]
WantedBy=multi-user.target

What I do wrong? How to pass also config file? Where I do mistake?

Subxt error: Metadata error: The generated code is not compatible with the node

When using the crunch tool v0.13.2 on the Polkadot-sdk v1.10.0 https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.10.0 on the Kusama chain throws this error

[2024-04-20T01:15:07Z INFO  crunch] crunch v0.13.2 * Crunch is a command-line interface (CLI) to claim staking rewards (flakes) every X hours for Substrate-based chains

[2024-04-20T01:15:07Z INFO  crunch::crunch] Connected to Kusama network using ws://127.0.0.1:9941 * Substrate node Parity Polkadot v1.10.0-7049c3c9883

[2024-04-20T01:15:07Z INFO  crunch::runtimes::kusama] Inspect and `crunch` unclaimed payout rewards
[2024-04-20T01:15:07Z ERROR crunch::crunch] Subxt error: Metadata error: The generated code is not compatible with the node
thread 'async-std/runtime' panicked at src/crunch.rs:308:76:
called `Result::unwrap()` on an `Err` value: MatrixError("access_token not defined")

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Trying to use crunch with Polkadex substrate chain fails with Invalid Metadata error

Hi,

We are trying to use crunch (latest crunch version, built from source, tried the binary too) with Polkadex chain and it fails with following error:

$ crunch --config-path /home/user/.env.pdex --substrate-ws-url ws://127.0.0.1:9945/ view
[2022-02-11T12:31:56Z INFO crunch] crunch v0.4.1 * Crunch is a command-line interface (CLI) to claim staking rewards (flakes) every X hours for Substrate-based chains
[2022-02-11T12:31:56Z ERROR crunch::crunch] Invalid Metadata: Invalid version
[2022-02-11T12:31:56Z INFO crunch::crunch] Awaiting for connection using ws://127.0.0.1:9945/


We also tried to save polkadex metadata using subxt to metadata/polkadex_metadata.scale and compiled crunch again, but no go. Attaching polkadex_metadata.scale
polkadex_metadata.txt

We are currently using crunch successfully for kusama chain. Any help is appreciated.

`Result::unwrap()` on an `Err` value: BadWordCount(1)

Since version v0.11.1 I get the following error:

Feb 28 23:33:43 goethe crunch[1340050]: thread 'async-std/runtime' panicked at src/crunch.rs:173:42:
Feb 28 23:33:43 goethe crunch[1340050]: called `Result::unwrap()` on an `Err` value: BadWordCount(1)
Feb 28 23:33:43 goethe crunch[1340050]: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Feb 28 23:33:43 goethe systemd[1]: crunch-bot.service: Main process exited, code=exited, status=101/n/a
Feb 28 23:33:43 goethe systemd[1]: crunch-bot.service: Failed with result 'exit-code'.

The expected behavior is that crunchbot pays out my nominators, which doesn't happen because of the error.

The error happens on an amd64 Ubuntu 22.04 cloud server.
I can confirm the error happening on v0.11.1, v0.11.2 and v12.0. Currently I run v10.1 which doesn't have this problem.

Authentification for stashes from remote url (Feature request)

in this function for remote url

pub async fn try_fetch_stashes_from_remote_url(
) -> Result<Option<Vec<String>>, CrunchError> {
    let config = CONFIG.clone();
    if config.stashes_url.len() == 0 {
        return Ok(None);
    }
    let response = reqwest::get(&config.stashes_url).await?.text().await?;
    let v: Vec<String> = response.split('\n').map(|s| s.to_string()).collect();
    if v.is_empty() {
        return Ok(None);
    }
    info!("{} stashes loaded from {}", v.len(), config.stashes_url);
    Ok(Some(v))
}

I would like to use some kind of authorization with this feature

e.g.

    [...]
    let client = Client::new();

    let user: Option<String> = &config.stashes_url_user;
    let password: Option<String> = &config.stashes_url_password;

    let response = client
        .get(&config.stashes_url)
        .basic_auth(user, password)
        .send();
   [...]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.