Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat 2.0 #383

Merged
merged 227 commits into from
Feb 21, 2025
Merged

Feat 2.0 #383

merged 227 commits into from
Feb 21, 2025

Conversation

zajko
Copy link
Contributor

@zajko zajko commented Dec 18, 2024

Merging condor feature branch to dev

zajko and others added 30 commits February 12, 2024 11:24
…s read. It will be stored in the event_log table. (#244)

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
* Moving rpc sidecar to event sidecar workspace. Both og those servers will work on one binary
* Updating schemars version because the old one is having bugs (if there is a name collision for components schema only one will be saved)
* Copying casper_types to this project. The reason is that casper_types in release <= 4.0.1 depends on old schemars
* Copying casper_types for 2.0 release to this project. The reason is that rpc sidecar has to use the new types definitions, but for now they are not released (and it's not clear if they will be released prior to node 2.0 release).
* Changing RpcError implementation to fix tests. Some alignments of codestyle to make clippy happy.
* Moving casper-types dependencies to workspace level

* Sync changes from node branch

* Update the schema file

* Delete protocol.md

* Move a DbId fix

* Change error message

* Changes to versioning

* Sync changes to types

* Switch to having a single binary

* Moving config files, fixing compilation issues

* bump 'juliet' to '0.2.1'

* Sync casper-types changes

* Changing RPC sidecar config so that the rpc_server.node_client.exponential_backoff will take a new parameter called max_attempts. I tcan be either "infinite" or a positive, non-zero number.

* Storing ApiVersion in event_log table. Removing is_big_integer_id config from DDLConfiguration because it's no longer needed (new version of sea_query handles the situation of defining big_integer and autoincrement)

* Revert "Storing ApiVersion in event_log table. Removing is_big_integer_id con…"

* Update for node review changes (#15)

* Update for node changes

* Fix lints

* Cleanup

* Cover all values in tag roundtrip tests

* Moving admin server out from the sse sidecar. They are spinned up separately from sse events server. Also the database initialization happens separetely. Is sse events server is defined a storage definition is required. If rest api server is defined a storage definition is required.

* Fix GlobalStateRequest::random

* Changes explicit BoxFuture casting to calling 'boxed()' method

---------

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
Co-authored-by: Rafał Chabowski <rafal@casperlabs.io>
Co-authored-by: Rafał Chabowski <88321181+rafal-ch@users.noreply.github.com>
Co-authored-by: zajko <ja.zajko@gmail.com>
…REST API endpoint with /transaction/deploy/(...) and /transaction/version1/(...) endpoints. (#245)

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
* Move merkle proof to casper-types and cleanup

* Remove casper types stuff
* Update for InformationRequest::Transaction change

* Fix test failures due to version mismatches

* Run formatter

* Bump commit
#248)

* Adding network_name as a field in event_log. It is fetched from `/status` endpoint of the node to which sidecar connects to.

---------

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
… event. Instead we wrap the sse events in an envelope which looks like: (#252)

```
    {
        "header": {
            "api_version": "2.0.0",
            "network_name": "casper"
        },
        "payload": {(...)}
    }
    ```

Events in endpoints that return lists (like signatures for block) will also have each individual element of the list wrapped in such envelope.
In the above the header fields:
* "api_version" is the api version which was reported in the ApiVersion message for the node that we fetched the event from.
* "network_name" is the "chainspec_name" field that was returned in the "/status" endpoint for the node that we fetched the event from.

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
* Update usage of ReactorState

* Update schema
In Condor, we introduced new bid records in global state that are stored
under the `Key::BidAddr` key type. We need to include these records when
creating the auction info.

Signed-off-by: Alexandru Sardan <alexandru@casperlabs.io>
rpc-sidecar: include new style bid records in auction info
* restructured metrics (moved to separate module)
* added rest-api specific metrics (current connections, response times)
* added db specific metrics (amount of data fetched from "raw" fields for events)
* added rpc specific metrics

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
* Fix auction state tests

* Fix a clippy lint

* Disable part of the workflow for now

* Workaround for non-PRs
…so it's easier to fine-tune what should actually run. If configuration for all components is either missing or has `enable_server = false`, sidecar exits since it has nothing to do. Also did some refactoring of initialization code. (#262)

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
* Bump casper types and refresh schema file

* Fix test data
* Switch block reporting changes

* Correct typo in name

* Bump types
…ntation. (#264)

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
… a package to fail (#265)

* Removing lingering references to "casper-event-sidecar". The whole project should now be called "casper-sidecar"
* Moving packaging configuration from "event-sidecar" module to "sidecar" which aggrgates the final binary

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
… sidecar after 2.0 update (#266)

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
zajko and others added 2 commits December 18, 2024 02:31
* aligning with node changes

---------

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
…d with newest node code (#385)

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
zajko and others added 3 commits January 10, 2025 14:16
* Introduced "state_get_auction_info_v2" json rpc method.

---------

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
#393)

* Refactoring "state_get_auction_info" and "state_get_auction_info_v2" to make less binary port requests

---------

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
colored = "2.0.0"
futures-util = { workspace = true }
once_cell = { workspace = true }
pg-embed = { git = "https://github.com/zajko/pg-embed", branch = "bump_dependencies" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a "release" of this before merging?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is a test dependency. We could check if that library upgraded since the time I forked it to update dependencies

zajko and others added 11 commits January 21, 2025 11:18
…de. (#394)

* Added missing error variants to handle error codes returned by the node.

* Removing catch-all statement
#395)

* Refreshing casper-node dependency, refactoring tests for 'chain_get_era_info_by_switch_block'

* applying CR remarks
* Changing error messages in case of node disconnection;
* cleaning up unused properties
* removing request_limit and the logic attached to that since we don't actually handle multiple in-flight requests to binary-port
* Removing the possibility to define "infinite" as a valid retry amount in node client connector since it can lead to deadlocks. That allowed removal of RpcServerConfigTarget, NodeClientConfigTarget, ExponentialBackoffConfigTarget and MaxAttemptsTarget since we don't need custom code for deserialization of the config file.
* Added some metrics to track unwanted events (timeouts on connection/sending/receiving data from binary port, detecting response id mismatch)
* Changed buckets definitions in RESPONSE_TIME_MS_BUCKETS constant
* Added MAX_COMPONENT_STARTUP_TIMEOUT_SECS guard in case one of the components hangs on startup
* Making keepalive loop use the standard mechnism of sending messages to gain retries and id-checks
* Aligning message_timeout_secs
Rename SignedBlock to BlockWithSignatures
* Aligning sidecar with various changes made to nodes binary port

* update cargo.toml

* rename binary request to command

---------

Co-authored-by: Jakub Zajkowski <jakub@casperlabs.io>
Co-authored-by: igor-casper <152597353+igor-casper@users.noreply.github.com>
Co-authored-by: igor-casper <igor@casper.network>
Co-authored-by: Maciek <19913370+wojcik91@users.noreply.github.com>
@zajko zajko requested a review from wojcik91 February 6, 2025 16:29
@zajko zajko dismissed wojcik91’s stale review February 21, 2025 16:04

Maciej is currently not working on sidecar, although I did apply almost all his suggestions.

@zajko zajko merged commit 819fb79 into dev Feb 21, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants