Commit Graph
128 Commits
Author SHA1 Message Date
selsta 3774999763 serialization: validate RingCT prunable JSON type 2026-07-21 17:27:25 +02:00
Thomas fecef767c9 Fix spelling typos in comments and string literals 2026-06-27 09:53:48 +02:00
tobtoht 1fa00678c5 Merge pull request #10639
1bed4e8 serialization: handle EOF at varint boundary (selsta)
2026-05-28 13:03:30 +00:00
tobtoht 0d631acd51 Merge pull request #10241
108244c Add wire::json_writer, and use in some of ZMQ-PUB functions. (Lee *!* Clagett)
2026-05-25 18:47:39 +00:00
selsta 1bed4e8f39 serialization: handle EOF at varint boundary 2026-05-22 00:38:50 +02:00
Lee *!* Clagett 108244cdf5 Add wire::json_writer, and use in some of ZMQ-PUB functions. 2026-05-21 17:19:52 -04:00
Thomas 2c327aa325 fix spelling in comments and docs 2026-05-13 21:20:05 +02:00
tobtoht 90fc50c371 cmake: only link Boost Chrono where needed 2026-05-06 21:24:14 +02:00
Lee Clagett baa631ff75 Improve unpack reserve handling 2026-04-27 18:25:18 -04:00
jeffro256 c93c4fc829 Misc clang 21 fixes
* Use -O3 and other flags instead of -Ofast
  - https://discourse.llvm.org/t/rfc-deprecate-ofast/78687
  - https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
* Find libunwind library based on C++ compiler type, not C compiler type
* In stack_trace.cpp, pass stream modifiers to `std::stringstream` first, then send string to log
* In stack_trace.cpp, remove dead code related to `stack_trace_log` path
* Remove `virtual` method attributues from `final` class `cryptonote::core`
* Remove unused `this` capture in cryptonote protocol handler
* Remove unused variable `bad` in net node
* Use `std::make_unsigned` instead of `boost::make_unsigned`
  - https://github.com/boostorg/type_traits/issues/171
  - https://github.com/boostorg/type_traits/issues/202
  - https://github.com/boostorg/type_traits/pull/199
* Cleanup `include`s in pair serialization
* Test convergence b/t `std::make_unsigned` and `boost::make_unsigned`

Fixes compilation and silences warnings on:
clang version 21.1.6
Linux 6.18.8-3-cachyos
2026-02-09 09:42:32 -07:00
jeffro256 a817da5215 serialization: revert va_args_commaprefix usage 2025-11-13 11:48:13 -06:00
tobtoht 8e7af0806e Merge pull request #10000
a2f336d serialization: massage pair casting to remove user-defined-cast warnings (jeffro256)
2025-08-01 12:01:49 +00:00
jeffro256 a2f336d22f serialization: massage pair casting to remove user-defined-cast warnings
Similar to: https://github.com/sstsimulator/sst-core/pull/1315
2025-07-16 00:03:42 -05:00
tobtoht ff000b654d Merge pull request #9927
6fd3a2e tools::variant: remove (jeffro256)
2025-07-10 12:32:20 +00:00
jeffro256 6fd3a2e06b tools::variant: remove 2025-05-15 13:48:36 -05:00
0xFFFC0000 d106e21b74 src: fix clangd warnings 2025-05-01 05:27:35 +00:00
Lee *!* Clagett f8ecd31743 Fix copies in ZMQ input/output 2025-03-18 01:11:12 -04:00
luigi1111 91b0a249e3 Merge pull request #9560
eb6f12c serialization: silence warning about shifting uint8_t by 8 (jeffro256)
2024-12-23 10:53:35 -05:00
luigi1111 44fef7903c Merge pull request #9336
04fe6fa split variant into plain and optional, add variant serialization (koe)
2024-12-23 10:26:23 -05:00
jeffro256 eb6f12c213 serialization: silence warning about shifting uint8_t by 8
Some compilers are stupid and give a warning on this line when `T = uint8_t`, even though it will never run
2024-11-08 15:06:32 -06:00
jeffro256 59cddbb9ca serialization: support passing extra args to fields in DSL
This PR is upstreaming changes in the Seraphis lib here: https://github.com/UkoeHB/monero/pull/39. The changes to the serialization header allow clean passing
of extra arguments to field serialization in the DSL. This is used mainly to pass implied sizes of containers during deserialization to make the format more
compact. For example, if my object has two containers A & B which must be the same size, I can serialize only the size of container A. Then, during
deserialization, when I deserialize A, I can then use A's size to deserialize B.

Depends on #9286.
2024-08-13 12:05:24 -05:00
luigi1111 93d6e0964e Merge pull request #9384
88afcdb Fix ZMQ DaemonInfo: (Lee *!* Clagett)
2024-08-13 12:15:28 -04:00
koe 04fe6fa63f split variant into plain and optional, add variant serialization 2024-08-02 13:18:57 -05:00
luigi1111 cfd7f5222d Merge pull request #9370
9fc48f4 Fix ZMQ Tx Pruning (Lee Clagett)
2024-07-16 18:56:44 -04:00
Lee *!* Clagett 88afcdb8fa Fix ZMQ DaemonInfo:
* top_block_hash was never set in handler
  * wide_difficulty was never sent in JSON
  * wide_cumulative_difficulty was never sent in JSON
2024-06-24 19:57:20 -04:00
Lee Clagett 9fc48f4a8a Fix ZMQ Tx Pruning 2024-06-18 21:26:28 -04:00
copyCat 341771ac3e copyright: bump to 2024 2024-05-21 16:29:33 +00:00
luigi1111 eb35250895 Merge pull request #9257
d6609b8 serialization: do any N-tuple (jeffro256)
2024-05-20 23:31:17 -05:00
luigi1111 689381dff9 Merge pull request #9194
9d101d5 serialization: protect blob serialization from undefined behavior (jeffro256)
2024-05-20 23:12:28 -05:00
jeffro256 d6609b83d6 serialization: do any N-tuple 2024-03-19 14:49:36 -05:00
jeffro256 9d101d5ea0 serialization: protect blob serialization from undefined behavior
There is currently no compiler protection when someone tries to
do (for example) `BLOB_SERIALIZER(std::vector<int>)`. You just
get runtime allocation errors. This has already eaten up dev time
before, so this PR adds a static assertion that the type must be
trivially copyable, as defined by the C++ standard. Types can
override this if applicable if they use `BLOB_SERIALIZER_FORCED`.
2024-03-10 14:15:48 -05:00
jeffro256 2a2da79943 free function serialization DSL
Example usage for Seraphis types (in global or `sp` namespace):

```
BEGIN_SERIALIZE_OBJECT_FN(sp::SpCoinbaseEnoteCore)
    FIELD_F(onetime_address)
    VARINT_FIELD_F(amount)
END_SERIALIZE()

BEGIN_SERIALIZE_OBJECT_FN(sp::SpEnoteCore)
    FIELD_F(onetime_address)
    FIELD_F(amount_commitment)
END_SERIALIZE()
```
2024-02-24 11:24:47 -06:00
jeffro256 2525200185 serialization: remove container wrappers and serialize directly
Some downstream code (most notably PR https://github.com/UkoeHB/monero/pull/25) wants to use the src/serialization lib
for storing information persistently. When one builds classes/machines wishing to serialize containers, they must use
the `serializable_*` container classes. In this case, this makes the Seraphis library code unnecessarily tightly coupled
with the src/serialization code since one cannot swap out their type of storage format without major refactoring of class
field types. By serializing STL containers directly, we can abstract the serialization details away, making for much
cleaner design. Also small bonus side effect of this change is that STL containers with custom Comparators, Allocators,
and Hashers are serializable. `std::multimap` is added to the list of serializable containers.

Depends upon https://github.com/monero-project/monero/pull/9069.
2023-11-28 14:06:24 -06:00
jeffro256 a11e03afa6 serialization: fix infinite loops and clean up dispatching
Resolves #8687
2023-11-18 03:47:55 -06:00
Lee Clagett 2608b241c8 Add CLSAG serialization to ZMQ code 2023-06-10 11:55:48 -04:00
Jeffrey Ryan 408079661d serialization: remove unused function dump_json 2023-04-25 11:39:55 -05:00
mj-xmrandmj-xmr 5b4fea72cf Copyright: Update to 2023
Co-authored-by: plowsof <plowsof@protonmail.com>
extra files
2023-01-16 13:00:18 +01:00
moneromooo-monero c5579ac236 allow exporting outputs in chunks
this will make it easier huge wallets to do so without hitting
random limits (eg, max string size in node).
2022-08-18 06:53:41 +00:00
Jeffrey b7978cfd4e Remove src/serialization/list.h
Unused ;)

Also a comment from serialization.h
2022-05-02 12:08:05 -05:00
j-berman ea87b30f89 Add view tags to outputs to reduce wallet scanning time
Implements view tags as proposed by @UkoeHB in MRL issue
https://github.com/monero-project/research-lab/issues/73

At tx construction, the sender adds a 1-byte view tag to each
output. The view tag is derived from the sender-receiver
shared secret. When scanning for outputs, the receiver can
check the view tag for a match, in order to reduce scanning
time. When the view tag does not match, the wallet avoids the
more expensive EC operations when deriving the output public
key using the shared secret.
2022-04-18 00:49:53 -07:00
mj-xmr 4db6aed98c CMake: Add missing headers via monero_find_all_headers macro 2022-04-06 08:12:44 +02:00
luigi1111 0eb1b570b6 Merge pull request #8197
da9aa1f Copyright: Update to 2022 (mj-xmr)
2022-04-06 00:08:53 -04:00
moneromooo-monero a0d80b1f95 plug bulletproofs plus into consensus 2022-04-05 18:50:17 +00:00
mj-xmr da9aa1f7f8 Copyright: Update to 2022 2022-03-04 06:59:20 +01:00
SChernykh dfee15eee1 RPC and ZeroMQ APIs to support p2pool
Adds the following:

- "get_miner_data" to RPC API
- "json-miner-data" to ZeroMQ subscriber contexts

Both provide the necessary data to create a custom block template. They are used by p2pool.

Data provided:

- major fork version
- current height
- previous block id
- RandomX seed hash
- network difficulty
- median block weight
- coins mined by the network so far
- mineable mempool transactions
2021-09-11 15:15:07 +02:00
SChernykh b48074fb8d Fixed json serialization of rct::RCTTypeNull
rct::RCTTypeNull doesn't have these fields (ecdhInfo, outPk, txnFee).
2021-07-18 10:52:14 +02:00
luigi1111 7499837a6f Merge pull request #7661
08e4497 Improve cryptonote (block and tx) binary read performance (Lee Clagett)
2021-06-10 12:00:54 -05:00
selsta 451b5a510e clang: fix -Wrange-loop-analysis warnings 2021-04-27 05:30:27 +02:00
moneromooo-monero f9b5b521e8 fix serialization being different on mac
On Mac, size_t is a distinct type from uint64_t, and some
types (in wallet cache as well as cold/hot wallet transfer
data) use pairs/containers with size_t as fields. Mac would
save those as full size, while other platforms would save
them as varints. Might apply to other platforms where the
types are distinct.

There's a nasty hack for backward compatibility, which can
go after a couple forks.
2021-03-05 23:42:33 +00:00
Lee Clagett 08e4497c6e Improve cryptonote (block and tx) binary read performance 2021-01-23 06:23:39 +00:00