Skip to content

Commit be47f19

Browse files
papyrus_node: remove central_source_integration_test (#10491)
* papyrus_node: remove central_source_integration_test * apollo_l1_gas_price: add config items to handle fusaka upgrade * papyrus_base_layer: add code to calculate data price in the era of Fusaka
1 parent 969e855 commit be47f19

File tree

11 files changed

+141
-110
lines changed

11 files changed

+141
-110
lines changed

.github/workflows/papyrus_ci.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,6 @@ jobs:
7979

8080
# - name: Run p2p sync end-to-end test
8181
# run: scripts/papyrus/p2p_sync_e2e_test/main.sh ${{ secrets.CI_BASE_LAYER_NODE_URL }}
82-
83-
integration-test:
84-
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
85-
steps:
86-
- uses: actions/checkout@v4
87-
- uses: ./.github/actions/bootstrap
88-
with:
89-
github_token: ${{ secrets.GITHUB_TOKEN }}
90-
- run: >
91-
cargo test
92-
--test latency_histogram
93-
--test gateway_integration_test
94-
--test feeder_gateway_integration_test
95-
-- --include-ignored --skip test_gw_integration_testnet;
96-
cargo run -p papyrus_node --bin central_source_integration_test --features="futures-util tokio-stream"
97-
9882
test-no-rpc:
9983
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
10084
steps:

.github/workflows/papyrus_nightly-tests.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,6 @@ jobs:
7676
github_token: ${{ secrets.GITHUB_TOKEN }}
7777
- run: cargo build -p papyrus_load_test
7878

79-
integration-test:
80-
runs-on: macos-latest
81-
if: github.event.schedule == '30 0 * * *'
82-
steps:
83-
- uses: actions/checkout@v4
84-
- uses: ./.github/actions/bootstrap
85-
with:
86-
github_token: ${{ secrets.GITHUB_TOKEN }}
87-
- run: >
88-
cargo test
89-
--test latency_histogram
90-
--test gateway_integration_test
91-
--test feeder_gateway_integration_test
92-
-- --include-ignored --skip test_gw_integration_testnet;
93-
cargo run -p papyrus_node --bin central_source_integration_test --features="futures-util tokio-stream"
94-
9579
# TODO(dvir): make this run only if the path 'crates/apollo_storage/src/db/**' (same path as in the CI) was changed on the
9680
# last day and increase the number of repetitions.
9781
random-table-test:

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/papyrus/default_config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44
"privacy": "Private",
55
"value": "https://mainnet.infura.io/v3/%3Cyour_api_key%3E"
66
},
7+
"base_layer.fusaka_no_bpo_start_block_number": {
8+
"description": "The block number at which the Fusaka upgrade was deployed (not including any BPO updates).",
9+
"privacy": "Public",
10+
"value": 0
11+
},
12+
"base_layer.bpo1_start_block_number": {
13+
"description": "The block number at which BPO1 update was deployed.",
14+
"privacy": "Public",
15+
"value": 0
16+
},
17+
"base_layer.bpo2_start_block_number": {
18+
"description": "The block number at which BPO2 update was deployed.",
19+
"privacy": "Public",
20+
"value": 0
21+
},
722
"base_layer.prague_blob_gas_calc": {
823
"description": "If true use the blob gas calculcation from the Pectra upgrade. If false use the EIP 4844 calculation.",
924
"privacy": "Public",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"base_layer_config.fusaka_no_bpo_start_block_number": 9408577,
3+
"base_layer_config.bpo1_start_block_number": 9456501,
4+
"base_layer_config.bpo2_start_block_number": 9504747,
25
"base_layer_config.prague_blob_gas_calc": true,
36
"base_layer_config.timeout_millis": 1000
47
}

crates/apollo_node/resources/config_schema.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@
99
"privacy": "Private",
1010
"value": "https://mainnet.infura.io/v3/%3Cyour_api_key%3E"
1111
},
12+
"base_layer_config.bpo1_start_block_number": {
13+
"description": "The block number at which BPO1 update was deployed.",
14+
"privacy": "Public",
15+
"value": 0
16+
},
17+
"base_layer_config.bpo2_start_block_number": {
18+
"description": "The block number at which BPO2 update was deployed.",
19+
"privacy": "Public",
20+
"value": 0
21+
},
22+
"base_layer_config.fusaka_no_bpo_start_block_number": {
23+
"description": "The block number at which the Fusaka upgrade was deployed (not including any BPO updates).",
24+
"privacy": "Public",
25+
"value": 0
26+
},
1227
"base_layer_config.prague_blob_gas_calc": {
1328
"description": "If true use the blob gas calculcation from the Pectra upgrade. If false use the EIP 4844 calculation.",
1429
"privacy": "Public",

crates/papyrus_base_layer/src/base_layer_test.rs

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,56 @@ async fn get_gas_price_and_timestamps() {
9999
..Default::default()
100100
};
101101

102-
// Test pectra blob.
103-
104102
let mocked_block_response =
105103
&Some(Block::new(AlloyRpcHeader::new(header), BlockTransactions::<B256>::default()));
104+
105+
// Test fusaka blob.
106+
base_layer.config.fusaka_no_bpo_start_block_number = 0;
107+
base_layer.config.bpo1_start_block_number = 10;
108+
base_layer.config.bpo2_start_block_number = 10;
109+
106110
asserter.push_success(mocked_block_response);
107111
let header = base_layer.get_block_header(0).await.unwrap().unwrap();
108112

109113
assert_eq!(header.base_fee_per_gas, 5);
110114

115+
// See eip4844::fake_exponential().
116+
// Roughly e ** (BLOB_GAS / eip7691::BLOB_GASPRICE_UPDATE_FRACTION_PECTRA)
117+
let expected_fusaka_blob_calc = 7;
118+
assert_eq!(header.blob_fee, expected_fusaka_blob_calc);
119+
120+
// Test BPO1 blob.
121+
base_layer.config.fusaka_no_bpo_start_block_number = 0;
122+
base_layer.config.bpo1_start_block_number = 0;
123+
base_layer.config.bpo2_start_block_number = 10;
124+
125+
asserter.push_success(mocked_block_response);
126+
let header = base_layer.get_block_header(0).await.unwrap().unwrap();
127+
128+
// See eip4844::fake_exponential().
129+
// Roughly e ** (BLOB_GAS / eip7691::BLOB_GASPRICE_UPDATE_FRACTION_PECTRA)
130+
let expected_bpo1_blob_calc = 3;
131+
assert_eq!(header.blob_fee, expected_bpo1_blob_calc);
132+
133+
// Test BPO2 blob.
134+
base_layer.config.fusaka_no_bpo_start_block_number = 0;
135+
base_layer.config.bpo1_start_block_number = 0;
136+
base_layer.config.bpo2_start_block_number = 0;
137+
138+
asserter.push_success(mocked_block_response);
139+
let header = base_layer.get_block_header(0).await.unwrap().unwrap();
140+
141+
let expected_bpo2_blob_calc = 2;
142+
assert_eq!(header.blob_fee, expected_bpo2_blob_calc);
143+
144+
// Test pectra blob.
145+
base_layer.config.fusaka_no_bpo_start_block_number = 10;
146+
base_layer.config.bpo1_start_block_number = 10;
147+
base_layer.config.bpo2_start_block_number = 10;
148+
149+
asserter.push_success(mocked_block_response);
150+
let header = base_layer.get_block_header(0).await.unwrap().unwrap();
151+
111152
// See eip4844::fake_exponential().
112153
// Roughly e ** (BLOB_GAS / eip7691::BLOB_GASPRICE_UPDATE_FRACTION_PECTRA)
113154
let expected_pectra_blob_calc = 7;

crates/papyrus_base_layer/src/ethereum_base_layer_contract.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,20 @@ impl BaseLayerContract for EthereumBaseLayerContract {
243243
return Ok(None);
244244
};
245245
let blob_fee = match block.header.excess_blob_gas {
246+
Some(excess_blob_gas) if self.config.bpo2_start_block_number <= block.header.number => {
247+
// Fusaka BPO2 update.
248+
eip7840::BlobParams::bpo2().calc_blob_fee(excess_blob_gas)
249+
}
250+
Some(excess_blob_gas) if self.config.bpo1_start_block_number <= block.header.number => {
251+
// Fusaka BPO1 update.
252+
eip7840::BlobParams::bpo1().calc_blob_fee(excess_blob_gas)
253+
}
254+
Some(excess_blob_gas)
255+
if self.config.fusaka_no_bpo_start_block_number <= block.header.number =>
256+
{
257+
// Fusaka update.
258+
eip7840::BlobParams::osaka().calc_blob_fee(excess_blob_gas)
259+
}
246260
Some(excess_blob_gas) if self.config.prague_blob_gas_calc => {
247261
// Pectra update.
248262
eip7840::BlobParams::prague().calc_blob_fee(excess_blob_gas)
@@ -310,6 +324,14 @@ impl PartialEq for EthereumBaseLayerError {
310324
pub struct EthereumBaseLayerConfig {
311325
pub node_url: Url,
312326
pub starknet_contract_address: EthereumContractAddress,
327+
// Note: dates of fusaka-related upgrades: https://eips.ethereum.org/EIPS/eip-7607
328+
// Note 2: make sure to calculate the block number as activation epoch x32.
329+
// The block number at which the Fusaka upgrade was deployed (not including any BPO updates).
330+
pub fusaka_no_bpo_start_block_number: L1BlockNumber,
331+
// The block number at which BPO1 update was deployed.
332+
pub bpo1_start_block_number: L1BlockNumber,
333+
// The block number at which BPO2 update was deployed.
334+
pub bpo2_start_block_number: L1BlockNumber,
313335
pub prague_blob_gas_calc: bool,
314336
#[serde(deserialize_with = "deserialize_milliseconds_to_duration")]
315337
pub timeout_millis: Duration,
@@ -332,6 +354,25 @@ impl SerializeConfig for EthereumBaseLayerConfig {
332354
"Starknet contract address in ethereum.",
333355
ParamPrivacyInput::Public,
334356
),
357+
ser_param(
358+
"fusaka_no_bpo_start_block_number",
359+
&self.fusaka_no_bpo_start_block_number,
360+
"The block number at which the Fusaka upgrade was deployed (not including any BPO \
361+
updates).",
362+
ParamPrivacyInput::Public,
363+
),
364+
ser_param(
365+
"bpo1_start_block_number",
366+
&self.bpo1_start_block_number,
367+
"The block number at which BPO1 update was deployed.",
368+
ParamPrivacyInput::Public,
369+
),
370+
ser_param(
371+
"bpo2_start_block_number",
372+
&self.bpo2_start_block_number,
373+
"The block number at which BPO2 update was deployed.",
374+
ParamPrivacyInput::Public,
375+
),
335376
ser_param(
336377
"prague_blob_gas_calc",
337378
&self.prague_blob_gas_calc,
@@ -356,6 +397,9 @@ impl Default for EthereumBaseLayerConfig {
356397
Self {
357398
node_url: "https://mainnet.infura.io/v3/<your_api_key>".parse().unwrap(),
358399
starknet_contract_address,
400+
fusaka_no_bpo_start_block_number: 0,
401+
bpo1_start_block_number: 0,
402+
bpo2_start_block_number: 0,
359403
prague_blob_gas_calc: true,
360404
timeout_millis: Duration::from_millis(1000),
361405
}

crates/papyrus_node/Cargo.toml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ default = ["rpc"]
1010
rpc = ["apollo_rpc"]
1111
testing = []
1212

13-
[[bin]]
14-
name = "central_source_integration_test"
15-
path = "src/bin/central_source_integration_test.rs"
16-
required-features = ["futures-util", "tokio-stream"]
17-
1813
[dependencies]
1914
anyhow.workspace = true
2015
apollo_central_sync.workspace = true
@@ -46,10 +41,6 @@ tracing.workspace = true
4641
tracing-subscriber = { workspace = true, features = ["env-filter"] }
4742
validator = { workspace = true, features = ["derive"] }
4843

49-
# Binaries dependencies
50-
futures-util = { workspace = true, optional = true }
51-
tokio-stream = { workspace = true, optional = true }
52-
5344
[dev-dependencies]
5445
apollo_infra_utils = { workspace = true, features = ["testing"] }
5546
apollo_test_utils.workspace = true

crates/papyrus_node/src/bin/central_source_integration_test.rs

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)