-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
books/architecture: add
Monero oddities
(#343)
* add `oddities/` * swap `Expected`, `Why`
- Loading branch information
1 parent
241088e
commit e8598a0
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Monero oddities | ||
This section is a list of any peculiar, interesting, | ||
or non-standard behavior that Monero has that is not | ||
planned on being changed or deprecated. | ||
|
||
This section exists to hold all the small yet noteworthy knowledge in one place, | ||
instead of in any single contributor's mind. | ||
|
||
These are usually behaviors stemming from implementation rather than protocol/cryptography. | ||
|
||
## Formatting | ||
This is the markdown formatting for each entry in this section. | ||
|
||
If applicable, consider using this formatting when adding to this section. | ||
|
||
```md | ||
# <concise_title_of_the_behavior> | ||
|
||
## What | ||
A detailed description of the behavior. | ||
|
||
## Expected | ||
The norm or standard behavior that is usually expected. | ||
|
||
## Why | ||
The reasoning behind why this behavior exists and/or | ||
any links to more detailed discussion on the behavior. | ||
|
||
## Affects | ||
A (potentially non-exhaustive) list of places that this behavior can/does affect. | ||
|
||
## Example | ||
An example link or section of code where the behavior occurs. | ||
|
||
## Source | ||
A link to original `monerod` code that defines the behavior. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Little-endian IPv4 addresses | ||
|
||
## What | ||
Monero encodes IPv4 addresses in [little-endian](https://en.wikipedia.org/wiki/Endianness) byte order. | ||
|
||
## Expected | ||
In general, [networking-related protocols/code use _networking order_ (big-endian)](https://en.wikipedia.org/wiki/Endianness#Networking). | ||
|
||
## Why | ||
TODO | ||
|
||
- <https://github.com/monero-project/monero/issues/3826> | ||
- <https://github.com/monero-project/monero/pull/5544> | ||
|
||
## Affects | ||
Any representation and (de)serialization of IPv4 addresses must keep little | ||
endian in-mind, e.g. the P2P wire format or `int` encoded IPv4 addresses in RPC. | ||
|
||
For example, [the `ip` field in `set_bans`](https://www.getmonero.org/resources/developer-guides/daemon-rpc.html#set_bans). | ||
|
||
For Cuprate, this means Rust's [`Ipv4Addr::from_bits/from`](https://doc.rust-lang.org/1.82.0/src/core/net/ip_addr.rs.html#1182) cannot be used in these cases as [it assumes big-endian encoding](https://doc.rust-lang.org/1.82.0/src/core/net/ip_addr.rs.html#540). | ||
|
||
## Source | ||
- <https://github.com/monero-project/monero/blob/893916ad091a92e765ce3241b94e706ad012b62a/contrib/epee/include/net/net_utils_base.h#L97> |