Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

[bug][regression] IPNS pubsub fails to update records #3875

Closed
munavailable opened this issue Sep 16, 2021 · 4 comments
Closed

[bug][regression] IPNS pubsub fails to update records #3875

munavailable opened this issue Sep 16, 2021 · 4 comments
Assignees
Labels
kind/maybe-in-helia need/analysis Needs further analysis before proceeding need/maintainer-input Needs input from the current maintainer(s)

Comments

@munavailable
Copy link

munavailable commented Sep 16, 2021

Description:

Subscribed IPNS records don't get updated over pubsub. After the first record is stored in the datastore, it seems that no newer sequences can override it.

It looks like the code in datastore-pubsub is sending the wrong parameters to the IPNS validator.

// it sends the key then an array containing the currentRecord and the newRecord
this._selectRecord(key, [currentRecord, val])

While the ipns code expects just the 2 records as params:

select: (dataA, dataB)

Also there seems to be another issue in the selection code here:

async _selectRecord (key, records) {
    const res = await this._validator.select(key, records)

    // If we return true the new record will be stored
    // but if we use the same order in the array select(old, new)
    // it will return 0 if the old record is newer and 1 if the new record is newer
    return res === 0
}

This issue is a blocker for IPNS over pubsub. Also there's another issue blocking IPNS over DHT. So at the moment IPNS seems to be broken in js-ipfs.

Steps to reproduce the error:

NodeB subscribes to a KeyA
NodeA publishes an IPNS record with KeyA
NodeB receives the update and stores it in the pubsub datastore
NodeA publishes an updated IPNS record with KeyA
NodeB fails to compare the 2 records and keeps the old one

  • Version:
    ipfs-core: 0.10.6

  • Subsystem:
    datastore-pubsub
    ipns

Severity:

Medium - A non-essential functionality does not work, performance issues, etc.

@munavailable munavailable added the need/triage Needs initial labeling and prioritization label Sep 16, 2021
@welcome
Copy link

welcome bot commented Sep 16, 2021

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@munavailable
Copy link
Author

@munavailable munavailable changed the title IPNS pubsub fails to update records [bug][regression] IPNS pubsub fails to update records Sep 19, 2021
@BigLep BigLep added need/analysis Needs further analysis before proceeding and removed need/triage Needs initial labeling and prioritization labels Sep 24, 2021
@tinytb tinytb moved this to Weekly Candidates in IP JS (PL EngRes) v2 Oct 14, 2022
@SgtPooki SgtPooki moved this to 🥞 Todo in js-ipfs deprecation May 17, 2023
@SgtPooki
Copy link
Member

js-ipfs is being deprecated in favor of Helia. You can #4336 and read the migration guide.

Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterward (see #4336).

Leaving assigned to Alex to review.

Maybe related to libp2p/js-libp2p-delegated-content-routing#49

@SgtPooki SgtPooki added need/maintainer-input Needs input from the current maintainer(s) kind/maybe-in-helia labels May 26, 2023
@SgtPooki SgtPooki moved this from 🥞 Todo to 🛑 Blocked in js-ipfs deprecation May 26, 2023
@achingbrain
Copy link
Member

This should have been fixed in https://github.com/ipfs/helia-ipns - if it's not please open an issue on that repo.

@github-project-automation github-project-automation bot moved this from 🛑 Blocked to ✅ Done in js-ipfs deprecation May 30, 2023
@github-project-automation github-project-automation bot moved this from Next to Done in IP JS (PL EngRes) v2 May 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/maybe-in-helia need/analysis Needs further analysis before proceeding need/maintainer-input Needs input from the current maintainer(s)
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants