massalabs / massalabs/DeWeb

CLI lib, update site owner in indexer extra cost

Open
#246 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
11
Forks
2
PR merge metrics
No merged PRs in 30d

Description

When updating the owner of a website in the indexer (when editing a website on deweb uploader for example), there is an extra cost of 0.0004 MAS added to the Coin field of the operation.

### How to
The issue happens in the cli/src/lib/index/index.ts, the function used by updateIndexScWebsite to estimate coins field of the updateWebsite function of the indexer SC. If the deweb contract address has an owner on the indexer sc, the function would calculate the cost of updating the owner dataentry. To do that, it use the storageCostForEntry function which add a 0.0004 MAS cost for storing a new entry. However we are not creating a new datastore entry but just update an existing one (more precisely we remove one and create a new one) so the 0.0004 MAS extra cost is for nothing.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in cli/src/lib/index/index.ts, focusing on the function used by updateIndexScWebsite to estimate the coins field for the indexer's updateWebsite operation. Check the existing-owner path and the storageCostForEntry calculation. Done means updating an existing owner no longer includes the unnecessary 0.0004 MAS cost.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.