Skip to content

Commit 33be533

Browse files
committed
evm: TransceiverRegistry split
1 parent 3d799d7 commit 33be533

File tree

2 files changed

+188
-153
lines changed

2 files changed

+188
-153
lines changed

evm/NOTES.md

Lines changed: 26 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,27 @@
1-
# Notes on splitting token from base
1+
# Notes on changes made in this integration branch
22

3-
## MangerBase
3+
This file is meant to document the work in progress on this integration branch. It can probably be deleted (or the information moved some place better) before this PR is merged.
44

5-
### Implements (Should it implement all these?)
5+
This integration branch is PR #21.
66

7-
- IManagerBase,
8-
- TransceiverRegistry,
9-
- PausableOwnable,
10-
- ReentrancyGuardUpgradeable,
11-
- Implementation
7+
## Sub Branches
128

13-
### Functionality Provided
9+
Note that the indentation indicates branch dependencies.
1410

15-
- Stores the following:
16-
- Transceiver registry
17-
- Thresholds
18-
- Attestations
19-
- Message sequence number
20-
- Has the following functionality:
21-
- `quoteDeliveryPrice`
22-
- Record attestation
23-
- Send message
11+
- **evm_TransceiverRegistry_split** (PR #22) - This branch splits transceiver admin into a separate contract.
12+
- **evm/add_MsgManager** (PR #23) - Creates `MsgManagerBase` and `MsgManager` and makes `NttManager` inherit from `MsgManagerBase`.
13+
- **evm/add_SharedWormholeTransceiver** (PR #25) - Adds a shareable transceiver.
2414

25-
### Simple Changes Made
15+
## The change that wasn't made
2616

27-
- Moved the following from `ManagerBase` to `NttManager:
17+
It is unfortunate that `token` and `mode` exist in `ManagerBase` rather than `NttManager`.
18+
I tried moving them, but that increases the size of `NttManagerNoRateLimiting` considerably.
19+
I'm not sure why that is, or how to avoid it, so I did not pursue that change at this time.
20+
However, some of the other changes also cause that increase, so maybe we can revist this.
2821

29-
- Token
30-
- Mode
31-
- `_prepareForTransfer`
22+
## Contract Sizes
3223

33-
### Possible Ideas
34-
35-
- Maybe we could [like an external library](https://book.getfoundry.sh/reference/forge/forge-create#linker-options) for admin functionality.
36-
37-
### Contract Sizes
38-
39-
#### Before we started
24+
### Before we started
4025

4126
```bash
4227
evm (main)$ forge build --sizes --via-ir --skip test
@@ -49,14 +34,10 @@ evm (main)$ forge build --sizes --via-ir --skip test
4934
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
5035
| NttManagerNoRateLimiting | 17,141 | 18,557 | 7,435 | 30,595 |
5136
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
52-
| TestManager | 8,981 | 10,259 | 15,595 | 38,893 |
53-
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
5437

5538
```
5639

57-
- Note the `TestManager` just instantiates `ManagerBase.sol`.
58-
59-
#### After simple changes
40+
### After moving token and mode (the change that wasn't made)
6041

6142
```bash
6243
evm (main)$ forge build --sizes --via-ir --skip test
@@ -66,50 +47,35 @@ evm (main)$ forge build --sizes --via-ir --skip test
6647
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
6748
| NttManagerNoRateLimiting | 18,788 | 20,281 | 5,788 | 28,871 |
6849
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
69-
| TestManager | 8,368 | 9,511 | 16,208 | 39,641 |
70-
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
7150

7251
```
7352

74-
```
75-
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
76-
| NttManager | 23,907 | 25,510 | 669 | 23,642 |
77-
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
78-
| NttManagerHelpersLib | 58 | 87 | 24,518 | 49,065 |
79-
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
80-
| NttManagerNoRateLimiting | 18,644 | 20,130 | 5,932 | 29,022 |
81-
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
82-
```
83-
84-
- Question: Why did `NttManagerNoRateLimiting` grow so much??
85-
86-
#### Creating TransceiverRegistryAdmin
87-
88-
#### Before
53+
## Creating TransceiverRegistryAdmin
8954

9055
```bash
9156
evm (main)$ forge build --sizes --via-ir --skip test
9257

93-
╭-----------------------------------------+------------------+-------------------+--------------------+---------------------╮
94-
| Contract | Runtime Size (B) | Initcode Size (B) | Runtime Margin (B) | Initcode Margin (B) |
95-
+===========================================================================================================================+
9658
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
97-
| NttManager | 24,066 | 25,673 | 510 | 23,479 |
59+
| NttManager | 23,220 | 26,937 | 1,356 | 22,215 |
9860
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
99-
| NttManagerNoRateLimiting | 17,141 | 18,557 | 7,435 | 30,595 |
61+
| NttManagerNoRateLimiting | 16,254 | 19,713 | 8,322 | 29,439 |
10062
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
10163

10264
```
10365

104-
#### After
66+
## Creating MsgManagerBase
10567

10668
```bash
10769
evm (main)$ forge build --sizes --via-ir --skip test
10870

10971
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
110-
| NttManager | 23,220 | 26,937 | 1,356 | 22,215 |
72+
| NttManager | 24,076 | 25,719 | 500 | 23,433 |
11173
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
112-
| NttManagerNoRateLimiting | 16,254 | 19,713 | 8,322 | 29,439 |
74+
| NttManagerNoRateLimiting | 18,496 | 19,949 | 6,080 | 29,203 |
75+
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
76+
| MsgManager | 12,540 | 13,745 | 12,036 | 35,407 |
77+
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
78+
| MsgManagerWithExecutor | 13,145 | 14,400 | 11,431 | 34,752 |
11379
|-----------------------------------------+------------------+-------------------+--------------------+---------------------|
11480

11581
```

0 commit comments

Comments
 (0)