forked from neonevm/neon-evm
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NDEV-2043: Improve performance of neon-api crate (#158)
The main purpose of this PR is to remove usages of [`block_in_place`](https://docs.rs/tokio/latest/tokio/task/fn.block_in_place.html) and to re-use the same code in both an async (`neon-api`) and non-async (`evm-loader`) context. - Replaced `#[cfg(feature = "tracing")]` with `#[cfg(target_os = "solana")]` and extended its usage to: - code from `evm-loader` crate used only as a library (`#[cfg(not(target_os = "solana")]`); - code from `evm-loader` crate used only as part of a Solana program (`#[cfg(target_os = "solana")]`). - Replaced [`axum`](https://github.com/tokio-rs/axum) with [`actix-web`](https://github.com/actix/actix-web), because most of the `evm-loader` crate is based on non-`Send` types and [`actix-web`](https://github.com/actix/actix-web) is a web framework which does not require `Future`s to be `Send`. Inspired from #107. - Used [`maybe_async`](https://github.com/fMeow/maybe-async-rs) crate to re-write common parts of `evm-loader` crate used both as an async library and as a non-async Solana program. This also removed all usages of [`block_in_place`](https://docs.rs/tokio/latest/tokio/task/fn.block_in_place.html). - Simplified all types related to multi-threading in the context of non-`Send` `Future`s: less `Arc`s, less `RwLock`s.
- Loading branch information
1 parent
6d70f9b
commit 548b294
Showing
57 changed files
with
1,401 additions
and
1,137 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
use crate::build_info::get_build_info; | ||
use axum::{http::StatusCode, Json}; | ||
use neon_lib::build_info_common::SlimBuildInfo; | ||
use actix_web::get; | ||
use actix_web::http::StatusCode; | ||
use actix_web::web::Json; | ||
use actix_web::Responder; | ||
|
||
#[tracing::instrument(ret)] | ||
pub async fn build_info() -> (StatusCode, Json<SlimBuildInfo>) { | ||
(StatusCode::OK, Json(get_build_info())) | ||
#[get("/build-info")] | ||
pub async fn build_info_route() -> impl Responder { | ||
(Json(get_build_info()), StatusCode::OK) | ||
} |
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
20 changes: 10 additions & 10 deletions
20
evm_loader/api/src/api_server/handlers/get_ether_account_data.rs
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
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
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
pub mod handlers; | ||
pub mod routes; | ||
pub mod state; |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.