hinto-janai
d3b7ca3e65
cuprated: RPC handlers ( #355 )
...
* import diffs
* small fixes, hardfork changes
* lints
* hard_fork
* apply diffs
* review fixes
* binaries/cuprated/src/rpc/request: `pub(super)` -> `pub(crate)`
* add `BlockChainContextService`, `on_get_block_hash`
* map `tower::BoxError` to `anyhow::Error`
* get_block
* connection_info
* hard_fork_info
* set_bans
* get_bans
* banned
* flush_transaction_pool
* get_output_histogram
* get_coinbase_tx_sum
* get_version
* get_fee_estimate
* get_alternate_chains
* relay_tx
* response_base: `fn` -> `const`
* get_transaction_pool_backlog
* prune
* calc_pow
* add_aux_pow
* get_tx_ids_loose
* generate_blocks
* get_info
* sync_info
* get_miner_data
* `BlockchainManagerRequest` docs
* docs, `ConnectionInfo`, `AddressType`
* sig docs, remove `HardForks` request
* clean imports
* fix `on_get_block_hash`, `generate_blocks`, `get_block_headers_range`
* fix `get_info`, `banned`
* fix `sync_info`
* fix `get_miner_data`
* initial `add_aux_pow` impl
* fix `calculate_pow`
* add_aux_pow
* `get_output_distribution`
* checkup
* `find_nonce()` + `add_aux_pow` async wrapper
* fixes
* `helper::block_header`
* review fixes
* fixes
* doc fix
* p2p: remove tmp `AddressBookRequest::NextNeededPruningSeed`
* lint/todo fixes
* fix bans
* merge diffs from https://github.com/Cuprate/cuprate/pull/272
* `cuprate_types::rpc`, `from` module for `cuprate_rpc_types`
* `rpc-types` -> `types` pt. 2
* type fixes, move fn to `-helper`
* clippy fix
* rpc: move json-rpc types away from macros
* !!
* move types, fix orphan impl + cyclic dependency
* architecture book
* fix json-rpc handlers
* remove `::<N>`
* fix clippy
* fix type defaults, use `Hex`
* return defaults, hex test
* json_rpc: get_block_template
* `/get_transactions`
* `/is_key_image_spent`
* !!
* `/get_transactions` hex
* most of `/send_raw_transaction`
* `/send_raw_transaction`, `/save_bc`, response_base
* `/peerlist`
* `/get_transaction_pool`
* `/get_transaction_pool_stats`
* finish other draft
* get_blocks_by_height, shared::get_outs
* `/get_o_indexes.bin`
* `/get_output_distribution.bin`
* clippy
* `/get_blocks.bin`
* rpc-interface: add restricted invariant comments
* restricted json-rpc error
* get_output_distribution
* module cleanup
* txpool: all_hashes
* `HexVec`
* fix `get_txid` for `/get_outs`
miner transaction was not accounted for
* fix doc tests
* fix conflict
* json-rpc fixes
* `get_transaction_pool_hashes` fix
* rpc/interface: fix cargo hack
* review fixes
* cargo hack fix
* use `monero_address`
* Update binaries/cuprated/src/rpc/handlers/json_rpc.rs
Co-authored-by: Boog900 <boog900@tutanota.com>
* Update binaries/cuprated/src/rpc/handlers/json_rpc.rs
Co-authored-by: Boog900 <boog900@tutanota.com>
* review fixes
* fix `get_hashes`
* fix `is_key_image_spent`
* fix key image types
* fixes
* fix book
* output timelock fix + `blockchain_context()`
* fix
* fix
* fix
* fix getblocks.bin
* `cuprate_types` doc
* output fix
* fixme
* rct output fix
* fix cast
* clippy
---------
Co-authored-by: Boog900 <boog900@tutanota.com>
2025-04-08 17:09:43 +01:00
10000b4b34
rpc/types: add missing defaults to fields ( #361 )
...
* add defaults to fields
* Update rpc/types/src/bin.rs
Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
---------
Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2025-01-08 01:58:43 +00:00
hinto-janai
38541dbfda
workspace: add/fix 1.83 lints ( #353 )
...
* 1.83 `cargo clippy --fix`
* fix type complexity, add `DbResult`
* clippy fix
* redb fix
* Update consensus/context/src/difficulty.rs
Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
---------
Co-authored-by: Boog900 <boog900@tutanota.com>
2024-11-28 19:53:59 +00:00
hinto-janai
01150ab84c
rpc/types: fix epee deserialization for GetBlocksResponse
( #345 )
...
* header + flatten
* fix optional values
* `fn error() -> String` -> `error!() -> &'static str`
* extract out `PoolInfo`
* fix cargo hack
2024-11-27 23:04:58 +00:00
hinto-janai
372cab24d7
cuprated: internal signatures required for RPC pt. 2 ( #320 )
...
* apply diffs
* clippy
* fix tests
* rpc: fix tests
* remove `BlockchainManagerRequest::Overview`
* cuprated/p2p: fix `ConnectionInfo`
* move `CalculatePow`
* remove `AddAuxPow`
* move `Spans` and `NextNeededPruningSeed`
* factor types into `cuprate-types`
* scope cargo features
* fix/doc type serde
* Update binaries/cuprated/src/rpc/request/address_book.rs
Co-authored-by: Boog900 <boog900@tutanota.com>
* Update binaries/cuprated/src/rpc/request/blockchain_context.rs
Co-authored-by: Boog900 <boog900@tutanota.com>
* Update binaries/cuprated/src/rpc/request/blockchain_manager.rs
Co-authored-by: Boog900 <boog900@tutanota.com>
* fmt
* txpool: collapse `TxEntry`
* `ConnectionId`
* fix import
* fix bin
---------
Co-authored-by: Boog900 <boog900@tutanota.com>
2024-11-01 22:25:55 +00:00
44981f2b24
CI: add cargo hack ( #170 )
...
* add workflow
* fix errors
* fix workflow
* install dependencies
* fix more errors
* Update CONTRIBUTING.md
* Update CONTRIBUTING.md
Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
* fix hack + enable it for cuprate-database
* move hack to main CI
* fix docs
* fix ci formatting
* fix txpool tests
* fix CONTRIBUTING.md formatting
* service -> tower::Service
* review fixes
* review fixes
* fix CI
---------
Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2024-11-01 20:22:14 +00:00
SyntheticBird
63216aecae
workspace: Defines cuprate members as workspace dependencies ( #326 )
...
Defines cuprate members as workspace dependencies
- Defines cuprate members as workspace dependencies
- Changed all `path` import into `workspace = true`
Co-authored-by: Boog900 <boog900@tutanota.com>
2024-10-24 23:12:30 +01:00
hinto-janai
d43f12ea3f
rpc-types: fix HardForkInfoRequest
( #310 )
...
* apply diffs
* fix tests
2024-10-11 18:51:16 +01:00
hinto-janai
80bfe0a34c
types: JSON representation types ( #300 )
...
* add `cuprate_types::json`
* docs
* `Option` -> flattened enums + prefix structs
* output enum
* docs
* todo!() epee impl
* cuprate-rpc-types: add comments
* cuprate-rpc-types: common `TxEntry` fields into prefix struct
* remove epee
* docs
* add `hex` module
* `From` serai types
* cleanup
* proofs
* tx from impls
* fix tx timelock
* add block value tests
* add ringct types
* add tx_v1, tx_rct_3 test
* clsag bulletproofs tx test
* clsag bulletproofs plus tx test
* docs
* fix hex bytes
* typo
* docs
2024-10-05 01:47:44 +01:00
hinto-janai
6502729d8c
lints: replace allow
with expect
( #285 )
...
* cargo.toml: add `allow_attributes` lint
* fix lints
* fixes
* fmt
* fix docs
* fix docs
* fix expect msg
2024-09-18 21:31:08 +01:00
hinto-janai
eead49beb0
lints: opt in manual lint crates ( #263 )
...
* cargo.toml: transfer existing lints
* rpc/interface: lints
* rpc/json-rpc: lints
* rpc/types: lints
* storage/blockchain: lints
* rpc/types: fix lints
* cargo.toml: fix lint group priority
* storage/blockchain: fix lints
* fix misc lints
* storage/database: fixes
* storage/txpool: opt in lints + fixes
* types: opt in + fixes
* helper: opt in + fixes
* types: remove borsh
* rpc/interface: fix test
* test fixes
* database: fix lints
* fix lint
* tabs -> spaces
* blockchain: `config/` -> `config.rs`
2024-09-02 18:12:54 +01:00
hinto-janai
5648bf0da0
rpc: remove temporary lints ( #255 )
...
* rpc: remove temporary lints for types
* rpc: remove temporary lints for json-rpc
* rpc: remove temporary lints for interface
* cfgs `1 tab` -> `4 spaces`
2024-08-20 23:50:31 +01:00
hinto-janai
bd375eae40
rpc-types: add traits and enum
requests/responses ( #241 )
...
apply diff
2024-08-01 22:04:22 +01:00
hinto-janai
a2bca1b889
rpc: add JSON doc-tests ( #232 )
...
* fixed-bytes: add `serde`, document feature flags
* fixed-bytes: add derives
* rpc: add `as _` syntax to macro
* rpc: use `ByteArrayVec` and `ContainerAsBlob` for binary types
* fixed-bytes: re-add derives
* rpc-types: dedup default value within macro
* readme: fixed bytes section
* types: custom epee - `BlockCompleteEntry`
* types: custom epee - `KeyImageSpentStatus`
* types: custom epee - `PoolInfoExtent`
* types: add `Status::Other(String)` variant
* types: custom epee - `TxEntry`, add `read_epee_field` macro
* bin: custom epee - `GetBlocks`
* types: add `serde.rs`
* misc: make `TxEntry` an `enum`, impl serde
* misc: `unimplemented!()` for `TxEntry`'s epee
* types: add `BlockCompleteEntry`
* rpc: replace `BlockCompleteEntry` with `cuprate-types`
* types: document `BlockCompleteEntry`
* bin: fix `number_of_fields` for `GetBlocksResponse`
* misc: add `Distribution`
* distribution: add todo
* misc fixes
* readme: add `(De)serialization invariants`
* distribution: compress variants
* types: add `block_complete_entry.rs`
* net: fix imports
* p2p: fix imports
* turn off default-features
* p2p: fix imports
* misc fixes
* Update net/wire/Cargo.toml
Co-authored-by: Boog900 <boog900@tutanota.com>
* distribution: module doc
* wire: re-export types
* test-utils: add `crate::rpc::types` module
* test-utils: conditional json doc-tests
* bin: use enum for `GetBlocksResponse`
* misc: use lowercase for stringify
* json: add test data, fix macro doc tests
* json: add all data
* other: add all data
* bin: add skeleton
* docs
* move type to correct file
* remove duplicated fields for custom epee
* rpc: `client/{client,constants}.rs` -> `client.rs`
* lib.rs: remove `clippy::module_inception`
* macros: add json doc test macro
* json: add some tests
* json: add doc-test for all types
* add all other JSON doc-tests
* move doc-test macros to files
* base: add doc-tests
* json: TODO distribution test
---------
Co-authored-by: Boog900 <boog900@tutanota.com>
2024-07-28 21:43:16 +01:00
hinto-janai
929d19c450
rpc: custom epee for misc/bin types ( #229 )
...
* fixed-bytes: add `serde`, document feature flags
* fixed-bytes: add derives
* rpc: add `as _` syntax to macro
* rpc: use `ByteArrayVec` and `ContainerAsBlob` for binary types
* fixed-bytes: re-add derives
* rpc-types: dedup default value within macro
* readme: fixed bytes section
* types: custom epee - `BlockCompleteEntry`
* types: custom epee - `KeyImageSpentStatus`
* types: custom epee - `PoolInfoExtent`
* types: add `Status::Other(String)` variant
* types: custom epee - `TxEntry`, add `read_epee_field` macro
* bin: custom epee - `GetBlocks`
* types: add `serde.rs`
* misc: make `TxEntry` an `enum`, impl serde
* misc: `unimplemented!()` for `TxEntry`'s epee
* types: add `BlockCompleteEntry`
* rpc: replace `BlockCompleteEntry` with `cuprate-types`
* types: document `BlockCompleteEntry`
* bin: fix `number_of_fields` for `GetBlocksResponse`
* misc: add `Distribution`
* distribution: add todo
* misc fixes
* readme: add `(De)serialization invariants`
* distribution: compress variants
* types: add `block_complete_entry.rs`
* net: fix imports
* p2p: fix imports
* turn off default-features
* p2p: fix imports
* misc fixes
* Update net/wire/Cargo.toml
Co-authored-by: Boog900 <boog900@tutanota.com>
* distribution: module doc
* wire: re-export types
* bin: use enum for `GetBlocksResponse`
* misc: use lowercase for stringify
* remove duplicated fields for custom epee
* types: remove `should_write()` for custom epee
* bin: split `GetBlocksResponse` variant fields into structs
* misc: split `Distribution` variant fields into structs
* small fixes
* put all fields in `read_epee_field!`
* distribution: (de)compress during epee/serde (de)serialization
* distribution: leave (de)compression functions as `todo!()`
---------
Co-authored-by: Boog900 <boog900@tutanota.com>
2024-07-25 16:46:41 +01:00
hinto-janai
0910c0a231
rpc: use ByteArrayVec
and ContainerAsBlob
( #227 )
...
* fixed-bytes: add `serde`, document feature flags
* fixed-bytes: add derives
* rpc: add `as _` syntax to macro
* rpc: use `ByteArrayVec` and `ContainerAsBlob` for binary types
* fixed-bytes: re-add derives
* rpc-types: dedup default value within macro
* readme: fixed bytes section
2024-07-13 01:26:11 +01:00
hinto-janai
5aeb8af4b4
rpc: implement other JSON types ( #221 )
...
* `serde/epee` feature flags
* modify type generator macros
* add `defaults.rs`
* add `free.rs`
* add `misc` module
* modify `base.rs`, `contants.rs`
* remove `binary_string.rs`, `status.rs`
* fix macro usage
* impl `other.rs`
* base: re-add `AccessRequestBase`
* fix default functions
* tx_entry: fix link
* other: fix default functions
* Update rpc/types/src/other.rs
Co-authored-by: Boog900 <boog900@tutanota.com>
* Update rpc/types/src/other.rs
Co-authored-by: Boog900 <boog900@tutanota.com>
---------
Co-authored-by: Boog900 <boog900@tutanota.com>
2024-07-10 22:31:56 +01:00
hinto-janai
303c165df7
rpc: implement .bin
types ( #220 )
...
* `serde/epee` feature flags
* modify type generator macros
* add `defaults.rs`
* add `free.rs`
* add `misc` module
* modify `base.rs`, `contants.rs`
* remove `binary_string.rs`, `status.rs`
* fix macro usage
* impl `bin.rs`
* base: re-add `AccessRequestBase`
* fix default functions
* tx_entry: fix link
* bin: fix default functions
2024-07-10 21:19:19 +01:00
hinto-janai
ecbb5ad3dc
rpc: implement /json_rpc
types ( #219 )
...
* `serde/epee` feature flags
* modify type generator macros
* add `defaults.rs`
* add `free.rs`
* add `misc` module
* modify `base.rs`, `contants.rs`
* remove `binary_string.rs`, `status.rs`
* fix macro usage
* impl `json.rs`
* base: re-add `AccessRequestBase`
* fix default functions
* tx_entry: fix link
* json: fix default functions
* json: fix `on_get_block_hash`, `submit_block`
* json: `status` -> `block_id`
* json: fix `SubmitBlockRequest`
* json: fix `OnGetBlockHashResponse`
The serialized `result` field will come from our `json-rpc` crate,
so the inner type should be a `transparent` string.
* json: `Response` -> `ResponseBase` for `SubmitBlock`
* Update rpc/types/src/json.rs
Co-authored-by: Boog900 <boog900@tutanota.com>
* json: fix `SubmitBlockRequest` doc test
---------
Co-authored-by: Boog900 <boog900@tutanota.com>
2024-07-10 21:12:40 +01:00
hinto-janai
136abf7edd
rpc: feature flags, macro changes, misc setup ( #218 )
...
* `serde/epee` feature flags
* modify type generator macros
* add `defaults.rs`
* add `free.rs`
* add `misc` module
* modify `base.rs`, `contants.rs`
* remove `binary_string.rs`, `status.rs`
* fix macro usage
* base: re-add `AccessRequestBase`
* fix default functions
* tx_entry: fix link
2024-07-09 22:58:02 +01:00
hinto-janai
e405786a73
rpc: start cuprate-rpc-types
( #147 )
...
* rpc: add `monero-rpc-types`
* lib.rs: add lints
* add base files, deps
* fix macro generation, doc test
* add `strum`, add `misc` module
* document struct generation macro
* add `GetHeight`
* lib.rs: create re-export macro
* macro changes, add few more types
* docs
* `monero-rpc-types` -> `cuprate-rpc-types`
* fix modules
* specify commit in macro, add () type aliases
* macro docs, fixes
* add `Status::Other(String)`
* add TODO for `strum`
* Update rpc/types/Cargo.toml
Co-authored-by: Boog900 <boog900@tutanota.com>
* add `BinaryString`
* add `ResponseBase`
* add `CORE_RPC_*` constants
* fix status; use `CORE_RPC_*` constants
* cargo.toml: add `epee_encoding`
* rpc: add epee_encoding impl for `Status`
* macro: add epee_encoding for every type
* remove `strum`
* add response bases
* add `CORE_RPC_STATUS_UNKNOWN`
* add response/request bases for epee
* create `base` module
* use different type for macro example
* move base / root types around
* docs, status serde test
* status: use `Status::Unknown` for `epee_default_value`
* json: add missing fields to `GetBlockTemplateRequest`
not sure I missed these
cc73fe7116/src/rpc/core_rpc_server_commands_defs.h (L947-L950)
---------
Co-authored-by: Boog900 <boog900@tutanota.com>
2024-06-26 22:24:05 +01:00