Coder Social home page Coder Social logo

athena's People

Contributors

dependabot[bot] avatar huichiaotsou avatar leobragaz avatar monikacat avatar riccardom avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

athena's Issues

Chain links not stored properly

Bug description

Currently DJuno stores the chain links by unique (desmos_address, external_address). However Desmos supports different chains with the same external address properly. So it can happen that we have multiple chains with different names but the same external address (eg. LikeCoin and Cosmos). Currently this is impossible inside DJuno and those links are not stored properly.

Steps to reproduce

  1. Create a first link with address A and chain name C
  2. Create a second link with address A and chain name D

The second link will not be stored since a link with address A already exists

Expected behavior

The links should be stored properly even if the external addresses are the same

Update to be Stargate compatible

Since the next version of Desmos is going to be based on Cosmos v0.40 (codename Stargate), we need to:

  1. Update the Juno dependency once that forbole/juno#8
  2. Make sure DJuno can work with Desmos Stargate and parse correctly all the messages

Performance improvement for queries

Bug description

Some queries to the djuno database are creating heavy load on the DB server. They seem to be running constantly - as soon as they complete, another instance is immediately started. Is it possible to do any optimisation/caching to make these quicker or less frequent?

Steps to reproduce

SELECT
  "_subs"."result_id",
  "_fld_resp"."root" AS "result"
FROM
  UNNEST(($1) :: uuid [ ], ($2) :: json [ ]) AS "_subs"("result_id", "result_vars")
  LEFT OUTER JOIN LATERAL (
    SELECT
      json_build_object($3, "profile"."root") AS "root"
    FROM
      (
        SELECT
          coalesce(json_agg("root"), $4) AS "root"
        FROM
          (
            SELECT
              row_to_json(
                (
                  SELECT
                    "_5_e"
                  FROM
                    (
                      SELECT
                        "_4_root.ar.root.application_links"."application_links" AS "application_links",
                        $5 AS "__typename"
                    ) AS "_5_e"
                )
              ) AS "root"
            FROM
              (
                SELECT
                  *
                FROM
                  "public"."profile"
                WHERE
                  (
                    ("public"."profile"."dtag") ILIKE ((("_subs"."result_vars" # > > ARRAY [ $6, $7 ])) :: text)
                  )
              ) AS "_0_root.base"
              LEFT OUTER JOIN LATERAL (
                SELECT
                  coalesce(json_agg("application_links"), $8) AS "application_links"
                FROM
                  (
                    SELECT
                      row_to_json(
                        (
                          SELECT
                            "_2_e"
                          FROM
                            (
                              SELECT
                                "_1_root.ar.root.application_links.base"."application" AS "application",
                                "_1_root.ar.root.application_links.base"."username" AS "username",
                                "_1_root.ar.root.application_links.base"."state" AS "state",
                                $9 AS "__typename"
                            ) AS "_2_e"
                        )
                      ) AS "application_links"
                    FROM
                      (
                        SELECT
                          *
                        FROM
                          "public"."application_link"
                        WHERE
                          (("_0_root.base"."address") = ("user_address"))
                      ) AS "_1_root.ar.root.application_links.base"
                  ) AS "_3_root.ar.root.application_links"
              ) AS "_4_root.ar.root.application_links" ON ($10)
          ) AS "_6_root"
      ) AS "profile"
  ) AS "_fld_resp" ON ($11)
SELECT
  "_subs"."result_id",
  "_fld_resp"."root" AS "result"
FROM
  UNNEST(($1) :: uuid [ ], ($2) :: json [ ]) AS "_subs"("result_id", "result_vars")
  LEFT OUTER JOIN LATERAL (
    SELECT
      json_build_object($3, "chain_link"."root") AS "root"
    FROM
      (
        SELECT
          coalesce(json_agg("root"), $4) AS "root"
        FROM
          (
            SELECT
              row_to_json(
                (
                  SELECT
                    "_4_e"
                  FROM
                    (
                      SELECT
                        "_0_root.base"."external_address" AS "external_address",
                        "_0_root.base"."user_address" AS "user_address",
                        "_0_root.base"."creation_time" AS "creation_time",
                        "_3_root.or.chain_config"."chain_config" AS "chain_config",
                        $5 AS "__typename"
                    ) AS "_4_e"
                )
              ) AS "root"
            FROM
              (
                SELECT
                  *
                FROM
                  "public"."chain_link"
                WHERE
                  (
                    ("public"."chain_link"."user_address") = ((("_subs"."result_vars" # > > ARRAY [ $6, $7 ])) :: text)
                  )
              ) AS "_0_root.base"
              LEFT OUTER JOIN LATERAL (
                SELECT
                  row_to_json(
                    (
                      SELECT
                        "_2_e"
                      FROM
                        (
                          SELECT
                            "_1_root.or.chain_config.base"."name" AS "name",
                            $8 AS "__typename"
                        ) AS "_2_e"
                    )
                  ) AS "chain_config"
                FROM
                  (
                    SELECT
                      *
                    FROM
                      "public"."chain_link_chain_config"
                    WHERE
                      (("_0_root.base"."chain_config_id") = ("id"))
                  ) AS "_1_root.or.chain_config.base"
              ) AS "_3_root.or.chain_config" ON ($9)
          ) AS "_5_root"
      ) AS "chain_link"
  ) AS "_fld_resp" ON ($10)

Expected behavior

Queries execute quicker or less frequently

MsgAcceptTransferRequest not handled properly

Bug description

One the Dtag is transferred bdjuno does not update the previous owner with the new Dtag.
https://explorer.desmos.network/accounts/desmos1a5v9a94edq686aesyf4ufrdedwjpn8jflv4mwc
https://explorer.desmos.network/accounts/desmos12jhz5njn5tz0yymr0amtynnzdq6ne3n0aucc4w

both accounts are listing as the owner of blastoise but in reality desmos12jhz5njn5tz0yymr0amtynnzdq6ne3n0aucc4w owns charizard

Steps to reproduce

  • create 2 address user-1 user-2
  • user-1 make profile
  • user-2 request user-1 profile
  • user-1 accept transfer and creates a new dtag

Expected behavior

The DTag of both profiles should be updated properly

Cannot unlink ApplicationLinks

Bug description

After sending a MsgUnlinkApplication djuno doesn’t delete the Application link.

Steps to reproduce

I tried to unlink my Twitch account and the chain deleted correctly the record ( LCD response ), but when I query Hasura with :

profile(where: {dtag: {_ilike: "luca"}}) {
    application_links {
      application
      username
    }
}

I still get the Twitch link in the response:

...
        },
        {
          "application": "twitch",
          "username": "lucag__"
        },
...

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.