Skip to content

Set chiado deprecated slots to zero#48

Closed
dapplion wants to merge 9 commits intowithdrawals-pullfrom
withdrawals-pull-fix-chiado
Closed

Set chiado deprecated slots to zero#48
dapplion wants to merge 9 commits intowithdrawals-pullfrom
withdrawals-pull-fix-chiado

Conversation

@dapplion
Copy link
Copy Markdown
Member

@dapplion dapplion commented Jun 22, 2023

Chiado network deployed for the shapella the contract at commit 13e1555. This contract version was latter replaced with the contract at commit 8fe75d2. The latter version leaves some storage slots orphan, which may cause problems in future updates.

This PR introduces a method to set the gap slots to zero. _deprecated_slots_gap variable is added once to set storage slots 69,70,71 back to zero

SBCDepositContract     │           withdrawableAmount           │      67      │                  t_mapping(t_address,t_uint256)                   │      32       │
SBCDepositContractOld  │ failedWithdrawalIndexByWithdrawalIndex │      68      │                   t_mapping(t_uint64,t_uint256)                   │      32       │
SBCDepositContractOld  │       numberOfFailedWithdrawals        │      69      │                             t_uint256                             │      32       │
SBCDepositContractOld  │          nextWithdrawalIndex           │      70      │                             t_uint64                              │       8       │
SBCDepositContractOld  │        failedWithdrawalsPointer        │      71      │                             t_uint256                             │      32       |

Deployment plan

  • Upgrade contract to this implementation
  • Call setSlotGapToZero
  • Forget about it

@dapplion dapplion force-pushed the withdrawals-pull-fix-chiado branch from 38261ff to e6ffc70 Compare June 22, 2023 18:19
@dapplion dapplion force-pushed the withdrawals-pull-fix-chiado branch from e6ffc70 to 2b9bca0 Compare June 22, 2023 18:23
dapplion and others added 2 commits June 22, 2023 22:03
Co-authored-by: 4rgon4ut <59182467+4rgon4ut@users.noreply.github.com>
Co-authored-by: 4rgon4ut <59182467+4rgon4ut@users.noreply.github.com>
@4rgon4ut 4rgon4ut mentioned this pull request Jun 23, 2023
@4rgon4ut 4rgon4ut requested a review from Barichek June 23, 2023 17:17
@filoozom
Copy link
Copy Markdown
Contributor

This script has been ran to its completion and all slots are now zeroed out on Chiado. Can we close this PR @dapplion?

@dapplion
Copy link
Copy Markdown
Member Author

All slots in chiado have been reset

@dapplion dapplion closed this Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants