Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ord 17.1 not working with wallet with a large number of inscriptions #3486

Closed
mgdevereux opened this issue Apr 9, 2024 · 4 comments
Closed

Comments

@mgdevereux
Copy link

Getting the following error when trying to check balance

error trying to connect: tcp connect error: Connection reset by peer (os error 54)
because: error trying to connect: tcp connect error: Connection reset by peer (os error 54)
because: tcp connect error: Connection reset by peer (os error 54)
because: Connection reset by peer (os error 54)

@0xprames
Copy link

0xprames commented Apr 9, 2024

this is occuring for me as well

it seems to be something about the size of the response sent back as a response from the server (?)

async fn output(
    Extension(server_config): Extension<Arc<ServerConfig>>,
    Extension(index): Extension<Arc<Index>>,
    Path(outpoint): Path<OutPoint>,
    AcceptJson(accept_json): AcceptJson,
  ) -> ServerResult {
    task::block_in_place(|| {
      println!("made it here1");
      let sat_ranges = index.list(outpoint)?;

      let indexed;
      println!("made it here2");

      let output = if outpoint == OutPoint::null() || outpoint == unbound_outpoint() {
        let mut value = 0;

        if let Some(ranges) = &sat_ranges {
          for (start, end) in ranges {
            value += end - start;
          }
        }

        indexed = true;

        TxOut {
          value,
          script_pubkey: ScriptBuf::new(),
        }
      } else {
        indexed = index.contains_output(&outpoint)?;

        index
          .get_transaction(outpoint.txid)?
          .ok_or_not_found(|| format!("output {outpoint}"))?
          .output
          .into_iter()
          .nth(outpoint.vout as usize)
          .ok_or_not_found(|| format!("output {outpoint}"))?
      };

      println!("made it here3");

      let inscriptions = index.get_inscriptions_on_output(outpoint)?;

      let runes = index.get_rune_balances_for_outpoint(outpoint)?;

      let spent = index.is_output_spent(outpoint)?;

      println!("made it here4");

      Ok(if accept_json {
        println!("formatting response");
        Json(api::Output::new(
          server_config.chain,
          inscriptions,
          outpoint,
          output,
          indexed,
          runes,
          sat_ranges,
          spent,
        ))
        .into_response()
      } else {
        println!("formatting response2");
        OutputHtml {
          chain: server_config.chain,
          inscriptions,
          outpoint,
          output,
          runes,
          sat_ranges,
          spent,
        }
        .page(server_config)
        .into_response()
      })
    })
  }

excuse the print statement debug logs, but the connection reset by peer seems to be occuring after the last log line:

./ord --index-runes --regtest --bitcoin-data-dir /Users/<redacted>/Library/Application\ Support/Bitcoin --data-dir . --height-limit 1500 server gives me:

formatting response
made it here4
formatting response
made it here4
formatting response
made it here4
formatting response
made it here4
formatting response
made it here4
formatting response
made it here4
formatting response
made it here4
formatting response
d

and this occurs when I run:

./ord --index-runes --regtest --bitcoin-data-dir /Users/<redacted>/Library/Application\ Support/Bitcoin --data-dir . --height-limit 1500 wallet batch --batch etch.yaml --fee-rate 10:

error: error sending request for url (http://127.0.0.1/output/<redacted>:0): error trying to connect: tcp connect error: Connection reset by peer (os error 54)
because: error trying to connect: tcp connect error: Connection reset by peer (os error 54)
because: tcp connect error: Connection reset by peer (os error 54)
because: Connection reset by peer (os error 54)

@cryptoni9n
Copy link
Collaborator

dupe of #3364

@cryptoni9n
Copy link
Collaborator

0.18.3 brings some improvements to this. Also this pending PR #3655

@cryptoni9n
Copy link
Collaborator

Additionally, #3621 should also help with this. Please retry in the latest version of ord and reopen if you are still experiencing an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants