Commit e0e9f60
authored
[network] onchain discovery tool (#228)
## Description
<!-- Please include a summary of the change, including which issue it
fixes or what feature it adds. Include relevant motivation, context and
documentation as appropriate. List dependencies that are required for
this change, if any. -->
This change implements a tool that can decodes a node address into BCS
format and validator can update their onchain address to make them
discoverable.
* Top level
```
adhoc command for l1 migration
Usage: l1-migration <COMMAND>
Commands:
generate-waypoint-genesis Generate waypoint and genesis files from database
network-address Convert between multiaddr strings and BCS hex format
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
```
* Network address command
```
Convert between multiaddr strings and BCS hex format
Usage: l1-migration network-address <COMMAND>
Commands:
encode Encode multiaddr string to BCS hex
decode Decode BCS hex to multiaddr string
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
```
* Encode
```
./l1-migration network-address encode --help
Encode multiaddr string to BCS hex
Usage: l1-migration network-address encode <MULTIADDR>
Arguments:
<MULTIADDR>
Multiaddr string to encode to BCS hex format
Example: /dns/validator.example.com/tcp/6180/noise-ik/a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890/handshake/1
Options:
-h, --help
Print help (see a summary with '-h')
```
* Decode
```
./l1-migration network-address decode --help
Decode BCS hex to multiaddr string
Usage: l1-migration network-address decode <HEX>
Arguments:
<HEX>
BCS hex string to decode to multiaddr format
Example:
0x013f04021576616c696461746f722e6578616d706c652e636f6d0524180720a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef12345678900801
Options:
-h, --help
Print help (see a summary with '-h')
```
## Type of Change
- [x] New feature
- [ ] Bug fix
- [ ] Breaking change
- [ ] Performance improvement
- [ ] Refactoring
- [ ] Dependency update
- [ ] Documentation update
- [ ] Tests
## Which Components or Systems Does This Change Impact?
- [ ] Validator Node
- [ ] Full Node (API, Indexer, etc.)
- [ ] Move/Aptos Virtual Machine
- [ ] Aptos Framework
- [ ] Aptos CLI/SDK
- [ ] Developer Infrastructure
- [x] Other (specify) tools
## How Has This Been Tested?
<!--
- Please ensure that the functionality introduced by this change is well
tested and verified to work as expected.
- Ensure tests cover both happy and unhappy paths.
- List and link relevant tests.
-->
Testnet address is updated onchain. everything looks good.
## Key Areas to Review
<!--
- Identify any critical parts of the code that require special attention
or understanding. Explain why these parts are crucial to the
functionality or architecture of the project.
- Point out any areas where complex logic has been implemented. Provide
a brief explanation of the logic and your approach to make it easier for
reviewers to follow.
- Highlight any areas where you are particularly concerned or unsure
about the code's impact on the change. This can include potential
performance or security issues, or compatibility with existing features.
-->
## Checklist
- [ ] I have read and followed the
[CONTRIBUTING](https://github.com/aptos-labs/aptos-core/blob/main/CONTRIBUTING.md)
doc
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I identified and added all stakeholders and component owners
affected by this change as reviewers
- [ ] I tested both happy and unhappy path of the functionality
- [ ] I have made corresponding changes to the documentation
<!-- Thank you for your contribution! -->3 files changed
+94
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
| |||
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
25 | 54 | | |
26 | 55 | | |
27 | 56 | | |
| |||
52 | 81 | | |
53 | 82 | | |
54 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
55 | 88 | | |
56 | 89 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
0 commit comments