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

Resize Reserves #165

Closed
wants to merge 8 commits into from
Closed

Resize Reserves #165

wants to merge 8 commits into from

Conversation

0xripleys
Copy link

@0xripleys 0xripleys commented Sep 15, 2023

Remaining things:

  • instruction should probably be gated
    • 600 bytes is arbitrary

Tested resize on beta:

https://solana.fm/tx/4uhFrsNuYpdqAMaKCZNriNweLp3kUUKdtLM1RmKjkFbA94fdtiQNyLFzFPopd8zRewT5xYBga6tbarqHbwXgxonL?cluster=mainnet-qn1

Pre resize account data:


Public Key: BmaPnWsJ7rev6HiT9Zv1pMHUxrzTVmiKNLHxBQvEJZvB
Balance: 0.00519912 SOL
Owner: BLendhFh4HGnycEDDFhbeFEUYLP4fXB5tTHMoTX8Dch5
Executable: false
Rent Epoch: 361
Length: 619 (0x26b) bytes
0000:   01 41 dc 1e  08 00 00 00  00 01 53 9b  12 0e c4 cf   .A........S.....
0010:   21 76 f5 c7  99 6d f4 12  97 af 76 41  61 e9 4d 84   !v...m....vAa.M.
0020:   c3 2a 39 d9  93 c2 eb 70  a5 7e c6 fa  7a f3 be db   .*9....p.~..z...
0030:   ad 3a 3d 65  f3 6a ab c9  74 31 b1 bb  e4 c2 d2 f6   .:=e.j..t1......
0040:   e0 e4 7c a6  02 03 45 2f  5d 61 06 b6  09 ef aa 1f   ..|...E/]a......
0050:   2f e9 4e be  78 70 12 a6  d0 68 a7 7c  e4 87 85 fd   /.N.xp...h.|....
0060:   d0 25 8b 43  24 bc 59 af  39 24 ae ea  a0 20 c6 1c   .%.C$.Y.9$... ..
0070:   c4 79 71 28  13 46 1c e1  53 89 4a 96  a6 c0 0b 21   .yq(.F..S.J....!
0080:   ed 0c fc 27  98 d1 f9 a9  e9 c9 4a ab  e1 5a 70 5f   ...'......J..Zp_
0090:   0e d3 b8 9c  4a 7b f4 c8  53 99 ac cc  73 84 d7 fe   ....J{..S...s...
00a0:   4a 11 6a 10  99 91 89 4f  14 3d e6 34  c9 3c 00 00   J.j....O.=.4.<..
00b0:   00 00 00 28  0f 28 06 00  00 00 00 00  00 00 00 00   ...(.(..........
00c0:   00 00 00 1d  44 89 b0 ce  d0 56 0e 00  00 00 00 00   ....D....V......
00d0:   00 00 00 00  e0 26 1f 3a  89 e0 0d 00  00 00 00 00   .....&.:........
00e0:   00 00 00 63  2c 24 40 6c  2e 08 77 c7  e9 f5 f6 46   ...c,$@l..w....F
00f0:   7a 18 d6 c3  6e 67 9c 95  d1 18 d3 2f  d7 3a 92 81   z...ng...../.:..
0100:   c6 5e d9 b4  d3 3a 00 00  00 00 00 5a  20 7d c4 16   .^...:.....Z }..
0110:   f1 27 4d 78  80 99 05 ba  7a 97 59 3a  b0 02 0f d2   .'Mx....z.Y:....
0120:   4f 29 05 22  9e 03 ca 05  15 02 cd 50  28 01 2d 00   O).".......P(.-.
0130:   0c fa 00 80  c6 a4 7e 8d  03 00 00 c0  6e 31 d9 10   ......~.....n1..
0140:   01 00 14 40  78 7d 01 00  00 00 00 ff  ff ff ff ff   ...@x}..........
0150:   ff ff ff 3f  70 40 a6 5f  82 cd bd 89  5f 9c a1 26   ...?p@._...._..&
0160:   91 97 22 03  83 17 2c ba  e6 be 4d 3f  4c d2 1b d6   .."...,...M?L...
0170:   2d a9 2e 02  00 00 00 00  00 00 00 00  00 00 00 00   -...............
0180:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0190:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
01a0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
01b0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
01c0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
01d0:   00 00 00 00  00 00 50 fa  00 00 00 00  00 00 00 01   ......P.........
01e0:   2d 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   -...............
01f0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0200:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0210:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0220:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0230:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0240:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0250:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0260:   00 00 00 00  00 00 00 00  00 00 00                   ...........

post resize data


Public Key: BmaPnWsJ7rev6HiT9Zv1pMHUxrzTVmiKNLHxBQvEJZvB
Balance: 0.00937512 SOL
Owner: BLendhFh4HGnycEDDFhbeFEUYLP4fXB5tTHMoTX8Dch5
Executable: false
Rent Epoch: 361
Length: 1219 (0x4c3) bytes
0000:   01 41 dc 1e  08 00 00 00  00 01 53 9b  12 0e c4 cf   .A........S.....
0010:   21 76 f5 c7  99 6d f4 12  97 af 76 41  61 e9 4d 84   !v...m....vAa.M.
0020:   c3 2a 39 d9  93 c2 eb 70  a5 7e c6 fa  7a f3 be db   .*9....p.~..z...
0030:   ad 3a 3d 65  f3 6a ab c9  74 31 b1 bb  e4 c2 d2 f6   .:=e.j..t1......
0040:   e0 e4 7c a6  02 03 45 2f  5d 61 06 b6  09 ef aa 1f   ..|...E/]a......
0050:   2f e9 4e be  78 70 12 a6  d0 68 a7 7c  e4 87 85 fd   /.N.xp...h.|....
0060:   d0 25 8b 43  24 bc 59 af  39 24 ae ea  a0 20 c6 1c   .%.C$.Y.9$... ..
0070:   c4 79 71 28  13 46 1c e1  53 89 4a 96  a6 c0 0b 21   .yq(.F..S.J....!
0080:   ed 0c fc 27  98 d1 f9 a9  e9 c9 4a ab  e1 5a 70 5f   ...'......J..Zp_
0090:   0e d3 b8 9c  4a 7b f4 c8  53 99 ac cc  73 84 d7 fe   ....J{..S...s...
00a0:   4a 11 6a 10  99 91 89 4f  14 3d e6 34  c9 3c 00 00   J.j....O.=.4.<..
00b0:   00 00 00 28  0f 28 06 00  00 00 00 00  00 00 00 00   ...(.(..........
00c0:   00 00 00 1d  44 89 b0 ce  d0 56 0e 00  00 00 00 00   ....D....V......
00d0:   00 00 00 00  e0 26 1f 3a  89 e0 0d 00  00 00 00 00   .....&.:........
00e0:   00 00 00 63  2c 24 40 6c  2e 08 77 c7  e9 f5 f6 46   ...c,$@l..w....F
00f0:   7a 18 d6 c3  6e 67 9c 95  d1 18 d3 2f  d7 3a 92 81   z...ng...../.:..
0100:   c6 5e d9 b4  d3 3a 00 00  00 00 00 5a  20 7d c4 16   .^...:.....Z }..
0110:   f1 27 4d 78  80 99 05 ba  7a 97 59 3a  b0 02 0f d2   .'Mx....z.Y:....
0120:   4f 29 05 22  9e 03 ca 05  15 02 cd 50  28 01 2d 00   O).".......P(.-.
0130:   0c fa 00 80  c6 a4 7e 8d  03 00 00 c0  6e 31 d9 10   ......~.....n1..
0140:   01 00 14 40  78 7d 01 00  00 00 00 ff  ff ff ff ff   ...@x}..........
0150:   ff ff ff 3f  70 40 a6 5f  82 cd bd 89  5f 9c a1 26   ...?p@._...._..&
0160:   91 97 22 03  83 17 2c ba  e6 be 4d 3f  4c d2 1b d6   .."...,...M?L...
0170:   2d a9 2e 02  00 00 00 00  00 00 00 00  00 00 00 00   -...............
0180:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0190:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
01a0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
01b0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
01c0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
01d0:   00 00 00 00  00 00 50 fa  00 00 00 00  00 00 00 01   ......P.........
01e0:   2d 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   -...............
01f0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0200:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0210:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0220:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0230:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0240:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0250:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0260:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0270:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0280:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0290:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
02a0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
02b0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
02c0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
02d0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
02e0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
02f0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0300:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0310:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0320:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0330:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0340:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0350:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0360:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0370:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0380:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0390:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
03a0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
03b0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
03c0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
03d0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
03e0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
03f0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0400:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0410:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0420:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0430:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0440:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0450:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0460:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0470:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0480:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
0490:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
04a0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
04b0:   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
04c0:   00 00 00                                             ...


@codecov-commenter
Copy link

codecov-commenter commented Sep 15, 2023

Codecov Report

Attention: 99 lines in your changes are missing coverage. Please review.

Comparison is base (8674673) 83.62% compared to head (7b7c9e0) 83.14%.
Report is 1 commits behind head on v2.0.3_upcoming.

Files Patch % Lines
token-lending/program/src/processor.rs 5.76% 49 Missing ⚠️
token-lending/cli/src/main.rs 0.00% 34 Missing ⚠️
token-lending/sdk/src/instruction.rs 0.00% 16 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           v2.0.3_upcoming     #165      +/-   ##
===================================================
- Coverage            83.62%   83.14%   -0.48%     
===================================================
  Files                   50       50              
  Lines                18704    18811     +107     
===================================================
  Hits                 15641    15641              
- Misses                3063     3170     +107     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


let data: Vec<u8> = reserve_info.data.clone().borrow().to_vec();

assert!(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not the patten we typically use for constraints

@0xripleys 0xripleys changed the base branch from upcoming to v2.0.3_upcoming November 14, 2023 16:58
@0xripleys 0xripleys closed this Dec 18, 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.

None yet

3 participants