Skip to content

Limitarion in #71

@thiagonobrega

Description

@thiagonobrega

We have a limitation in the hyperdrive v2. The Hyperdrive can handle parallel requests:

All hyperdrive calls must be serialized

This is justified by the app/shared_utils.py :

It is important to remark that the limitation does not corrupt or lose data. The code could lose (waste) PIDs.

from dark import DarkMap, DarkGateway

# { address : "val"
#   arks : []
# }
 
LIMIAR = 100
MANAGED_ARK_DICT = {}


def get_pid(wallet_addr,dark_map:DarkMap):
    
    try:
        warks = MANAGED_ARK_DICT[wallet_addr]
    except KeyError:
        warks = dark_map.bulk_request_pid_hash()
        MANAGED_ARK_DICT[wallet_addr] = warks


    s = len(warks)
    if s < LIMIAR:
        r = int((LIMIAR- s)/100)
        for i in range(r):
            pids = dark_map.bulk_request_pid_hash()
            warks.extend(pids)
    
    ark_hash = warks.pop(0)
    # dark_map.dpid_db.caller.get(ark_hash)[1]
    return ark_hash

To make the hyperdrive accept parallel calls, we can use a database to manage the PIDs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions