wen-community / wen-program-library

Apache License 2.0
90 stars 20 forks source link

Step 1 for bump field set #81

Closed sunguru98 closed 4 months ago

sunguru98 commented 4 months ago

This step has the instructions to expand the account size by 1 byte (some accounts are more than that to ensure they are up to the current account's space + 1 byte).

There will be another PR, which has the actual bump set field.

The reason for 2 PRs is because, we cannot set any additional fields without increasing the account's space, but at the same time, anchor will cause IDL issues when deserializing old accounts. Hence, we ensure all the accounts have enough account space/rent to support the additional field by deploying the code present in this PR, and the upcoming one will refer toward the account without any IDL issues by redeploying again.

I've ran a simulation over localnet by cloning almost 250 accounts (150 on WNS and 100 on Distribution) from mainnet and they all seem to work as expected.

Once the bump field has been set, both PRs (this and the upcoming Step 2) and the issue can be closed, as these instructions weren't made for staying permanently.

sunguru98 commented 4 months ago

Some screenshots for the diff in space (even supporting old distribution accounts)

Mainnet

Screenshot 2024-05-10 at 12 53 48 AM

Localnet

Screenshot 2024-05-10 at 12 53 30 AM

sunguru98 commented 4 months ago

Removing DRAFT as it's required as a log in Github's code commit history.