Coder Social home page Coder Social logo

nucypher-porter's Issues

Consider increasing learning timeout

Occasionally, I'm getting timeouts:

david@Davids-MacBook-Pro-2 nucypher-contracts % curl -X GET <redacted>/get_ursulas -H "Content-Type: application/json" -d '{"quantity": 3}'
{"result": {"failure_message": "Execution stopped before completion - not enough available values (1 failures recorded)", "failures": [{"value": "0xb15d5A4e2be34f4bE154A1b08a94Ab920FfD8A41", "error": "HTTPSConnectionPool(host='<redacted>', port=9151): Read timed out. (read timeout=2)"}]}, "version": "3.1.1"}%  

It's possible that current default learning delay of 2 seconds is too short. See:

_SHORT_LEARNING_DELAY = 2

Properly validate network value provided to Porter via the CLI

Describe the Bug
A clear and concise description of what the bug is, and what you expected to happen.
image

To Reproduce
Steps to reproduce the behavior

Traceback or Screenshots (Optional)
If applicable, add the full error message / Traceback or upload screenshots to help explain your problem.

System (please complete the following information):

  • OS Version: ubuntu 18.3
  • Nucypher Version: 6.0.0
  • Ethereum Node Version:

Think about better error categorization (error codes?) regarding whether a retry of failed request(s) may work

From @piotr-roslaniec :

Just a question: If the decryption request fails, it must be because one of the participants failed. In that case, what do we do on the client side? Do we retry once and then rest our case or is there any other action we could take based on errors contents? At this point, the ritual is complete and validated.

From @derekpierre :

Good question. This is a possible improvement to our error handling. I think we've chatted previously (perhaps there is an issue somewhere) about possibly having integer error codes or something like that as part of the error information returned, then the errors can be contextualized appropriately eg. blip on connectivity vs something more problematic (wrong encrypting key used etc.). A blip in connectivity would signal a retry would possibly be successful.

That is something we can perhaps build upon.

Bump Porter version

Should we bump Porter's version? It is already 1.0.0 on mainnet. If semver, then we aren't introducing breaking API changes for TACo 7.0.0 so technically it would be a 1.1.0, although using 2.0.0 would be refreshing for the TACo 7.0.0 release.

Investigate optimizations when version restriction represents low percentage of node population

During sampling when the version being restricted represents only a small percentage of the network eg. 8/20 nodes run a version that we are sampling for, then sampling can take a long time. In this case 8/20 nodes running 7.4.1 pre-release, and sampling 8 took ~30s. However, this is a bit of a special case during pre-release testing, but the investigation could lead to overall efficiency improvements nonetheless.

From Discord:

Porter typically connects to each node, gets the json data from the status endpoint - this is the common uptime check - and then if version is restricted, compares the version. This is a bit of a special case because 7.4.1 isn't a widespread version that nodes are running, so getting some number n <= 8 when only 8 / ~120 nodes are running the required version could take some time.

For example, if we want to get all 8 nodes running v7.4.1, the worst case is getting the final 8th node on the 120th node being connected to (i.e. the last node to check). That means that Porter had to connect to all 120 nodes before returning. Now, of course Porter actually does parallel connections using a thread pool, so there is some parallelism that helps to reduce the time - not that it couldn't be further improved of course.

That being said, if even 50% of the network was running 7.4.1, it's very likely the query would take much less time. 

Error on `retrieve_cfrags` for multiple `retrieval_kits`

When making a call to the community testnet porter at https://porter-tapir.nucypher.community/retrieve_cfrags with more than ~2-3 retrieval_kits I get a lot of the following errors:

RuntimeError: Ursula ((Ursula)⇀LightBlue Charlie LavenderBlush Mike↽ (0xcbE2F626d84c556AbA674FABBbBDdbED6B39d87b)) seems to be down while trying to complete ReencryptionRequest: <nucypher_core.ReencryptionRequest object at 0x7fc6cc11ac10>

Is this a limitation of the testnet porter?

Also it seems to work much better if I make parallel requests with a single retrieval_kit but not sure if that is intended behavior

Implement Alice revoke functionality for Porter

Continuation of nucypher/nucypher#2703.

Implement /revoke once off-chain revoke is implemented; it is currently TBD after TMapConKFrags implementation (#2687 ) - see https://github.com/nucypher/nucypher/blob/main/nucypher/network/server.py#L278.

Original potential implementation for /revoke can be found here - nucypher/nucypher#2666 (comment). However, this implementation may/may not need to be modified based on what is eventually done for TMapConKFrags off-chain revocation.

Reduce dependency on nucypher/nucypher

There are constants, utilities, and cli option definitions being imported which can be handled locally. Consider the following modules:

porter/cli/help.py

from nucypher.config.constants import USER_LOG_DIR, DEFAULT_CONFIG_ROOT

porter/cli/porter.py

from nucypher.cli.options import (
    option_network,
    option_eth_provider_uri,
    option_federated_only,
    option_teacher_uri,
    option_registry_filepath,
    option_min_stake
)
from nucypher.cli.types import NETWORK_PORT
from nucypher.cli.utils import setup_emitter, get_registry
from nucypher.config.constants import TEMPORARY_DOMAIN

porter/controllers.py

from nucypher.config.constants import MAX_UPLOAD_CONTENT_LENGTH
from nucypher.network.resources import get_static_resources
from nucypher.utilities.concurrency import WorkerPoolException
from nucypher.utilities.emitters import StdoutEmitter
from nucypher.utilities.logging import Logger, GlobalLoggerSettings

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.