Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to change the ram_payer of secondary indices #266

Open
aaroncox opened this issue Feb 5, 2024 · 2 comments
Open

Add ability to change the ram_payer of secondary indices #266

aaroncox opened this issue Feb 5, 2024 · 2 comments

Comments

@aaroncox
Copy link

aaroncox commented Feb 5, 2024

Related conversation from Antelope Developers chat in Telegram.

https://t.me/antelopedevs/339008

Currently if you modify the ram_payer of a table row, the secondary indices of that table will not update unless the data related to the index changes. This prevents changing the owner of all the data related to that row unless:

  • The row is erased and then recreated.
  • One of the fields related to the index is changed.

I assume the first solution isn't ideal because erasing and recreating the row will be a heavier operation than a modification.

The second solution doesn't work unless you actually need to change the data related to all the indices. If you don't need to change the data, then you're forced to make 2x modify calls - one to the data to a temporary value and then one to change it back.

We opt'd currently to go for the second solution, for the sake of performance and less code to implement:

https://github.com/drops-system/drops/pull/27/files

What I'd expect is that if the ram_payer changes for the row, all the secondary indices related to that row also change.

If that's not possible, then exposing a function to modify the ram_payer of one or more indices would also work.

@aaroncox aaroncox changed the title Add ability to change the ram_payer of a secondary indices Add ability to change the ram_payer of secondary indices Feb 5, 2024
@ericpassmore
Copy link
Contributor

removed triage tag, and adding to backlog

@ericpassmore
Copy link
Contributor

request to change behavior in the eosiolib shipped as part of cdt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

3 participants