Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-dedicated-host.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ jobs:
host: ${{ secrets.DEDICATED_SERVER_IP_ADDRESS }}
username: textile
key: ${{ secrets.DEDICATED_SERVER_PRIVATE_KEY }}
script: bash -il /home/textile/scripts/deploy_subnet_under_calibration_net/deploy.sh ${{ github.ref_name }}
script: PARENT_HTTP_AUTH_TOKEN=${{ secrets.PARENT_HTTP_AUTH_TOKEN }} bash -il /home/textile/scripts/deploy_subnet_under_calibration_net/deploy.sh ${{ github.ref_name }}
command_timeout: 120m
2 changes: 1 addition & 1 deletion .github/workflows/redeploy-to-dedicated-host.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ jobs:
host: ${{ secrets.DEDICATED_SERVER_IP_ADDRESS }}
username: textile
key: ${{ secrets.DEDICATED_SERVER_PRIVATE_KEY }}
script: bash -il /home/textile/scripts/deploy_subnet_under_calibration_net/redeploy.sh ${{ github.ref_name }}
script: PARENT_HTTP_AUTH_TOKEN=${{ secrets.PARENT_HTTP_AUTH_TOKEN }} bash -il /home/textile/scripts/deploy_subnet_under_calibration_net/redeploy.sh ${{ github.ref_name }}
command_timeout: 120m
28 changes: 28 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ futures-util = "0.3"
gcra = "0.4"
hex = "0.4"
hex-literal = "0.4.1"
http = "0.2.12"
im = "15.1.0"
integer-encoding = { version = "3.0.3", default-features = false }
jsonrpc-v2 = { version = "0.11", default-features = false, features = [
Expand Down Expand Up @@ -165,6 +166,7 @@ tokio-stream = "0.1.14"
tokio-util = { version = "0.7.8", features = ["compat"] }
tokio-tungstenite = { version = "0.18.0", features = ["native-tls"] }
toml = "0.8"
tower-http = { version = "0.4.0", features = ["cors"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "registry"] }
tracing-appender = "0.2.3"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

default:
cd contracts && make gen
cargo build --release
cargo build --locked --release
./target/release/ipc-cli --version
./target/release/fendermint --version

Expand Down
10 changes: 5 additions & 5 deletions fendermint/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ diagrams:
make -C ../docs/fendermint/diagrams diagrams

build: $(IPC_ACTORS_GEN) | protoc npm
cargo build --release
cargo build --locked --release

install: $(IPC_ACTORS_GEN)
cargo install --locked --path app
Expand All @@ -43,7 +43,7 @@ test: $(BUILTIN_ACTORS_BUNDLE) $(IPC_ACTORS_GEN)
FM_BUILTIN_ACTORS_BUNDLE=$(BUILTIN_ACTORS_BUNDLE) \
FM_CUSTOM_ACTORS_BUNDLE=$(CUSTOM_ACTORS_BUNDLE) \
FM_CONTRACTS_DIR=$(IPC_ACTORS_OUT) \
cargo test --release \
cargo test --locked --release \
-p fendermint_abci \
-p fendermint_app \
-p fendermint_actor_objectstore \
Expand Down Expand Up @@ -74,7 +74,7 @@ test: $(BUILTIN_ACTORS_BUNDLE) $(IPC_ACTORS_GEN)
FM_BUILTIN_ACTORS_BUNDLE=$(BUILTIN_ACTORS_BUNDLE) \
FM_CUSTOM_ACTORS_BUNDLE=$(CUSTOM_ACTORS_BUNDLE) \
FM_CONTRACTS_DIR=$(IPC_ACTORS_OUT) \
cargo test --release \
cargo test --locked --release \
-p fendermint_actor_eam \
-p fendermint_vm_interpreter \
-p fendermint_vm_snapshot \
Expand All @@ -85,7 +85,7 @@ e2e: docker-build | cargo-make
cd testing/smoke-test && cargo make --profile $(PROFILE)
cd testing/snapshot-test && cargo make --profile $(PROFILE)
cd testing/graph-test && cargo make --profile $(PROFILE)
PROFILE=$(PROFILE) cargo test --package fendermint_materializer
PROFILE=$(PROFILE) cargo test --locked --package fendermint_materializer

clean:
cargo clean
Expand Down Expand Up @@ -149,7 +149,7 @@ $(BUILTIN_ACTORS_BUNDLE):

# Build a bundle CAR for the custom actors in this repo.
$(CUSTOM_ACTORS_BUNDLE):
cargo build --release -p fendermint_actors
cargo build --locked --release -p fendermint_actors

# Regenerate the ABI artifacts if we don't have them already, or they changed.
$(IPC_ACTORS_GEN): $(IPC_ACTORS_CODE)
Expand Down
16 changes: 11 additions & 5 deletions fendermint/app/config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ host = "127.0.0.1"
# JSON-RPC (POST) and WebSockets (GET) requests.
port = 8545

[eth.cors]
# A list of origins a cross-domain request can be executed from
# Default value '[]' disables cors support
# Use '["*"]' to allow any origin
allowed_origins = []
# A list of methods the client is allowed to use with cross-domain requests
# Suggested methods if allowing origins: "GET", "OPTIONS", "HEAD", "POST"
allowed_methods = []
# A list of non-simple headers the client is allowed to use with cross-domain requests
# Suggested headers if allowing origins: "Accept", "Authorization", "Content-Type", "Origin"
allowed_headers = []

# Proxy API facade
[proxy]
Expand All @@ -147,7 +158,6 @@ port = 8545
host = "127.0.0.1"
port = 8001


# IPLD Resolver Configuration
[resolver]
# Time to wait between attempts to resolve a CID after an error.
Expand All @@ -163,7 +173,6 @@ local_key = "keys/network.sk"
# so we can derive a name using the rootnet ID and use this as an override.
network_name = ""


# Peer Discovery
[resolver.discovery]
# Bootstrap node addresses for peer discovery, or the entire list for a static network
Expand All @@ -178,7 +187,6 @@ target_connections = 50
# Option to disable Kademlia, for example in a fixed static network.
enable_kademlia = true


# IPC Subnet Membership
[resolver.membership]
# User defined list of subnets which will never be pruned from the cache.
Expand Down Expand Up @@ -223,7 +231,6 @@ max_peers_per_query = 5
# consumer gets an error because it's falling behind.
event_buffer_capacity = 100


# Serving Content
[resolver.content]
# Number of bytes that can be consumed by remote peers in a time period. 0 means no limit.
Expand All @@ -246,7 +253,6 @@ vote_interval = 1
# pausing the syncer, preventing new events to trigger votes.
vote_timeout = 60


# # Setting which are only allowed if the `--network` CLI parameter is `testnet`.
# [testing]

Expand Down
2 changes: 0 additions & 2 deletions fendermint/app/options/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub enum EthCommands {
/// The URL of the Tendermint node's RPC endpoint.
#[arg(
long,
short,
default_value = "http://127.0.0.1:26657",
env = "TENDERMINT_RPC_URL"
)]
Expand All @@ -26,7 +25,6 @@ pub enum EthCommands {
/// The URL of the Tendermint node's WebSocket endpoint.
#[arg(
long,
short,
default_value = "ws://127.0.0.1:26657/websocket",
env = "TENDERMINT_WS_URL"
)]
Expand Down
1 change: 1 addition & 0 deletions fendermint/app/settings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ serde_json = { workspace = true }
serde_with = { workspace = true }
serial_test = { workspace = true }
tendermint-rpc = { workspace = true }
tower-http = { workspace = true }

fvm_shared = { workspace = true }
fvm_ipld_encoding = { workspace = true }
Expand Down
16 changes: 16 additions & 0 deletions fendermint/app/settings/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
// SPDX-License-Identifier: Apache-2.0, MIT

use fvm_shared::econ::TokenAmount;
use ipc_provider::config::deserialize::{
deserialize_cors_headers, deserialize_cors_methods, deserialize_cors_origins,
};
use serde::Deserialize;
use serde_with::{serde_as, DurationSeconds};
use std::time::Duration;
use tower_http::cors::{AllowHeaders, AllowMethods, AllowOrigin};

use crate::{IsHumanReadable, SocketAddress};

Expand All @@ -18,6 +22,7 @@ pub struct EthSettings {
pub cache_capacity: usize,
pub gas: GasOpt,
pub max_nonce_gap: u64,
pub cors: CorsOpt,
}

#[serde_as]
Expand All @@ -29,3 +34,14 @@ pub struct GasOpt {
pub num_blocks_max_prio_fee: u64,
pub max_fee_hist_size: u64,
}

#[serde_as]
#[derive(Debug, Clone, Deserialize)]
pub struct CorsOpt {
#[serde(deserialize_with = "deserialize_cors_origins")]
pub allowed_origins: AllowOrigin,
#[serde(deserialize_with = "deserialize_cors_methods")]
pub allowed_methods: AllowMethods,
#[serde(deserialize_with = "deserialize_cors_headers")]
pub allowed_headers: AllowHeaders,
}
5 changes: 4 additions & 1 deletion fendermint/app/settings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,10 @@ impl Settings {
.list_separator(",") // need to list keys explicitly below otherwise it can't pase simple `String` type
.with_list_parse_key("resolver.connection.external_addresses")
.with_list_parse_key("resolver.discovery.static_addresses")
.with_list_parse_key("resolver.membership.static_subnets"),
.with_list_parse_key("resolver.membership.static_subnets")
.with_list_parse_key("eth.cors.allowed_origins")
.with_list_parse_key("eth.cors.allowed_methods")
.with_list_parse_key("eth.cors.allowed_headers"),
))
// Set the home directory based on what was passed to the CLI,
// so everything in the config can be relative to it.
Expand Down
6 changes: 6 additions & 0 deletions fendermint/app/src/cmd/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,19 @@ async fn run(settings: EthSettings, client: HybridClient) -> anyhow::Result<()>
num_blocks_max_prio_fee: settings.gas.num_blocks_max_prio_fee,
max_fee_hist_size: settings.gas.max_fee_hist_size,
};
let cors = fendermint_eth_api::CorsOpt {
allowed_origins: settings.cors.allowed_origins,
allowed_methods: settings.cors.allowed_methods,
allowed_headers: settings.cors.allowed_headers,
};
fendermint_eth_api::listen(
settings.listen,
client,
settings.filter_timeout,
settings.cache_capacity,
settings.max_nonce_gap,
gas,
cors,
)
.await
}
9 changes: 5 additions & 4 deletions fendermint/eth/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ license.workspace = true
anyhow = { workspace = true }
async-trait = { workspace = true }
axum = { workspace = true }
cid = { workspace = true }
ethers-core = { workspace = true }
ethers-contract = { workspace = true }
erased-serde = { workspace = true }
Expand All @@ -19,16 +20,16 @@ jsonrpc-v2 = { workspace = true }
lazy_static = { workspace = true }
lru_time_cache = { workspace = true }
paste = { workspace = true }
serde = { workspace = true }
rand = { workspace = true }
regex = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tracing = { workspace = true }
tendermint = { workspace = true }
tendermint-rpc = { workspace = true }
tokio = { workspace = true }
tower-http = { workspace = true }

cid = { workspace = true }
fil_actors_evm_shared = { workspace = true }
fvm_shared = { workspace = true }
fvm_ipld_encoding = { workspace = true }
Expand All @@ -45,11 +46,11 @@ ethers = { workspace = true, features = ["abigen"] }
hex = { workspace = true }
lazy_static = { workspace = true }
rand = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
quickcheck = { workspace = true }
quickcheck_macros = { workspace = true }
thiserror = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }

fendermint_testing = { path = "../../testing", features = ["arb"] }
fendermint_vm_message = { path = "../../vm/message", features = ["arb"] }
Loading