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: irys token prices data added to the config #236

Merged
merged 44 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
6ae51ca
feat: add genesis token price information to the irys config
roberts-pumpurs Feb 19, 2025
1c738f7
wip: config restructuring
roberts-pumpurs Feb 20, 2025
0ee98f9
wip: config restructuring
roberts-pumpurs Feb 21, 2025
7d19892
fix: all compile warnings are gone
roberts-pumpurs Feb 21, 2025
731c2f4
fix: invalid processing of SigningKey
roberts-pumpurs Feb 21, 2025
164fd4a
test: fix some broken tests
roberts-pumpurs Feb 21, 2025
e0ae22e
fix: broken tests
roberts-pumpurs Feb 24, 2025
3fdefd7
test: fix brooken tests
roberts-pumpurs Feb 24, 2025
abbbc45
fix: broken test
roberts-pumpurs Feb 24, 2025
1db835d
wip
roberts-pumpurs Feb 24, 2025
075115a
Merge remote-tracking branch 'origin/master' into rob/prices-in-config
roberts-pumpurs Feb 24, 2025
7aa5822
test: add ignore attribute to paratitioin expiration
roberts-pumpurs Feb 24, 2025
5f65aa7
test: enable test utils for actors crate deps
roberts-pumpurs Feb 25, 2025
f058963
misc code improvements
roberts-pumpurs Feb 25, 2025
3154f60
refactor: chain id rename
roberts-pumpurs Feb 25, 2025
ee75ce3
test: toml file deserialization
roberts-pumpurs Feb 25, 2025
d8a7bc0
chore: remove unnecessary logs
roberts-pumpurs Feb 25, 2025
5a655bd
chore: renamed `irys_chain_id` to `chain_id` in the config structs
roberts-pumpurs Feb 25, 2025
a59df59
chore: cleanup
roberts-pumpurs Feb 25, 2025
05c113c
chore: cleanup
roberts-pumpurs Feb 25, 2025
3d69481
refactor: make tests easier to read
roberts-pumpurs Feb 25, 2025
54fdddc
fix: missing import
roberts-pumpurs Feb 25, 2025
cd4a721
Merge remote-tracking branch 'origin/master' into rob/prices-in-config
roberts-pumpurs Feb 25, 2025
09851e0
chore: remove useless casts in mempool service
roberts-pumpurs Feb 25, 2025
cf6606d
refactor: generating a new irys signer requires the config to be present
roberts-pumpurs Feb 25, 2025
dbccfc0
refactor: tracing will write to stdout
roberts-pumpurs Feb 25, 2025
9cfbff2
fix broken build
roberts-pumpurs Feb 25, 2025
14a385b
Fix epoch parameter confusion
ernius Feb 25, 2025
a7f3bc1
Merge remote-tracking branch 'origin/master' into rob/prices-in-config
roberts-pumpurs Feb 26, 2025
e461d7e
fix: post merge fixes
roberts-pumpurs Feb 26, 2025
4923d74
fix: broken tests
roberts-pumpurs Feb 26, 2025
4866716
fix: broken tests
roberts-pumpurs Feb 26, 2025
e5636f1
wip
roberts-pumpurs Feb 26, 2025
a6d961d
fix: broken tests
roberts-pumpurs Feb 26, 2025
24b900e
chore: unused deps
roberts-pumpurs Feb 26, 2025
8fe53f1
chore: fmt
roberts-pumpurs Feb 26, 2025
f89481b
chore: cargo.lock update
roberts-pumpurs Feb 26, 2025
b7ab42a
fix: checks for cuda-enabled tests
roberts-pumpurs Feb 26, 2025
c0f8d57
chore: update packing config
roberts-pumpurs Feb 26, 2025
1c0c5cd
chore: cargo check fix
roberts-pumpurs Feb 26, 2025
b78c0d8
chore: cargo check fixes
roberts-pumpurs Feb 26, 2025
40fb262
chore: missing params to nvidia-feature gated test
roberts-pumpurs Feb 26, 2025
94d9857
refactor: cleanup based on PR
roberts-pumpurs Feb 27, 2025
a45ac15
feat: if no config is provided, default to testnet config
roberts-pumpurs Feb 27, 2025
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 .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,4 @@
"cwd": "${workspaceFolder}"
}
]
}
}
6 changes: 4 additions & 2 deletions Cargo.lock

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

25 changes: 13 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,19 @@ alloy-contract = { path = "./ext/alloy/crates/contract" }
alloy-provider = { path = "./ext/alloy/crates/provider", features = ["trace-api"] }

arbitrary = { version = "1.3", features = ["derive"] }
once_cell = "1.19.0"
assert_matches = "1.5.0"
once_cell = "1.19" # todo can probably be removed
assert_matches = "1.5" # todo can probably be removed
bytes = "1.5"
derive_more = { version = "1", features = ["full"] }
eyre = "0.6"
color-eyre = "0.6.2"
itertools = "0.13.0"
color-eyre = "0.6"
itertools = "0.13"
futures = "0.3"
bytemuck = "1"

nodit = { version = "0.9.2", features = ["serde"] }
modular-bitfield = "0.11.2"
openssl = { version = "0.10.57", features = ["vendored"] }
nodit = { version = "0.9", features = ["serde"] }
modular-bitfield = "0.11"
openssl = { version = "0.10", features = ["vendored"] }
proptest-derive = "0.5"
reth = { path = "./ext/reth/bin/reth" }
reth-auto-seal-consensus = { path = "./ext/reth/crates/consensus/auto-seal" }
Expand Down Expand Up @@ -145,22 +145,23 @@ serde = { version = "1", default-features = false }
reth-rpc-layer = { path = "./ext/reth/crates/rpc/rpc-layer" }
serde_json = "1"
test-fuzz = "6"
thiserror = "1.0"
tokio = { version = "1.40.0", features = ["rt", "macros"] }
thiserror = "1"
tokio = { version = "1", features = ["rt", "macros"] }
toml = "0.8"
derive-syn-parse = "0"
proc-macro2 = "1"
quote = "1"
syn = { version = "2", features = ["full"] }
tracing = "0.1.0"
tracing = "0.1"
tracing-error = "0.2"
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt", "json"] }
alloy-signer = { path = "./ext/alloy/crates/signer" }
tempfile = "3.10"
tempfile = "3"
jsonrpsee = "0.24"
jsonrpsee-core = "0.24"
jsonrpsee-http-client = "0.24"
jsonrpsee-types = "0.24"
futures-util = "0.3.30"
futures-util = "0.3"

[patch.crates-io]
revm = { path = "./ext/revm/crates/revm" }
Expand Down
1 change: 1 addition & 0 deletions crates/actors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ workspace = true

[features]
nvidia = ["irys-packing/nvidia"]
test-utils = []
71 changes: 39 additions & 32 deletions crates/actors/src/block_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ pub fn poa_is_valid(
config.entropy_packing_iterations,
config.chunk_size as usize,
&mut entropy_chunk,
config.irys_chain_id,
);

let mut poa_chunk: Vec<u8> = poa.chunk.clone().into();
Expand Down Expand Up @@ -358,6 +359,7 @@ pub fn poa_is_valid(
config.entropy_packing_iterations,
config.chunk_size as usize,
&mut entropy_chunk,
config.irys_chain_id,
);

if entropy_chunk != poa.chunk.0 {
Expand Down Expand Up @@ -394,7 +396,7 @@ mod tests {
use irys_database::{BlockIndex, Initialized};
use irys_testing_utils::utils::temporary_directory;
use irys_types::{
irys::IrysSigner, partition::PartitionAssignment, Address, Base64, H256List,
irys::IrysSigner, partition::PartitionAssignment, Address, Base64, Config, H256List,
IrysTransaction, IrysTransactionHeader, Signature, TransactionLedger, H256, U256,
};
use std::sync::{Arc, RwLock};
Expand All @@ -412,6 +414,7 @@ mod tests {
pub miner_address: Address,
pub partition_hash: H256,
pub partition_assignment: PartitionAssignment,
pub testnet_config: Config,
}

async fn init() -> (TempDir, TestContext) {
Expand All @@ -424,31 +427,27 @@ mod tests {
.try_init();

let mut genesis_block = IrysBlockHeader::new_mock_header();

let mut testnet_config = Config::testnet();
let data_dir = temporary_directory(Some("block_validation_tests"), false);
genesis_block.height = 0;
let arc_genesis = Arc::new(genesis_block);

let miner_address = Address::random();
let signer = IrysSigner::from_config(&testnet_config);
let miner_address = signer.address();
let chunk_size = 32;
testnet_config.chunk_size = chunk_size;
testnet_config.num_chunks_in_partition = 10;
testnet_config.num_chunks_in_recall_range = 2;
testnet_config.num_partitions_per_slot = 1;
testnet_config.num_writes_before_sync = 1;
testnet_config.entropy_packing_iterations = 1_000;
testnet_config.chunk_migration_depth = 1;

// Create epoch service with random miner address
let storage_config = StorageConfig {
chunk_size,
num_chunks_in_partition: 10,
num_chunks_in_recall_range: 2,
num_partitions_in_slot: 1,
miner_address,
min_writes_before_sync: 1,
entropy_packing_iterations: 1_000,
chunk_migration_depth: 1, // Testnet / single node config
};
let storage_config = StorageConfig::new(&testnet_config);
let epoch_config = EpochServiceConfig::new(&testnet_config);

let config = EpochServiceConfig {
storage_config: storage_config.clone(),
..Default::default()
};

let epoch_service = EpochServiceActor::new(Some(config.clone()));
let epoch_service = EpochServiceActor::new(epoch_config.clone(), &testnet_config);
let epoch_service_addr = epoch_service.start();

// Tell the epoch service to initialize the ledgers
Expand All @@ -473,11 +472,9 @@ mod tests {
let sub_slots = ledgers.get_slots(Ledger::Submit);

let partition_hash = sub_slots[0].partitions[0];

let arc_config = Arc::new(IrysNodeConfig {
base_directory: data_dir.path().to_path_buf(),
..Default::default()
});
let mut config = IrysNodeConfig::new(&testnet_config);
config.base_directory = data_dir.path().to_path_buf();
let arc_config = Arc::new(config);

let block_index: Arc<RwLock<BlockIndex<Initialized>>> = Arc::new(RwLock::new(
BlockIndex::default()
Expand Down Expand Up @@ -519,13 +516,13 @@ mod tests {
miner_address,
partition_hash,
partition_assignment,
testnet_config,
},
)
}

#[actix::test]
async fn poa_test_3_complete_txs() {
let chunk_size: usize = 32;
let (_tmp, context) = init().await;
// Create a bunch of TX chunks
let data_chunks = vec![
Expand All @@ -536,7 +533,10 @@ mod tests {

// Create a bunch of signed TX from the chunks
// Loop though all the data_chunks and create wrapper tx for them
let signer = IrysSigner::random_signer_with_chunk_size(chunk_size);
let signer = IrysSigner::random_signer_with_chunk_size(
context.testnet_config.chunk_size,
context.testnet_config.irys_chain_id,
);
let mut txs: Vec<IrysTransaction> = Vec::new();

for chunks in &data_chunks {
Expand All @@ -559,7 +559,7 @@ mod tests {
poa_tx_num,
poa_chunk_num,
9,
chunk_size,
context.testnet_config.chunk_size as usize,
)
.await;
}
Expand All @@ -569,10 +569,12 @@ mod tests {
#[actix::test]
async fn poa_not_complete_last_chunk_test() {
let (_tmp, context) = init().await;
let chunk_size: usize = 32;

// Create a signed TX from the chunks
let signer = IrysSigner::random_signer_with_chunk_size(chunk_size);
let signer = IrysSigner::random_signer_with_chunk_size(
context.testnet_config.chunk_size,
context.testnet_config.irys_chain_id,
);
let mut txs: Vec<IrysTransaction> = Vec::new();

let data = vec![3; 40]; //32 + 8 last incomplete chunk
Expand All @@ -583,8 +585,12 @@ mod tests {
let poa_tx_num = 0;

for poa_chunk_num in 0..2 {
let mut poa_chunk: Vec<u8> = data[poa_chunk_num * chunk_size
..std::cmp::min((poa_chunk_num + 1) * chunk_size, data.len())]
let mut poa_chunk: Vec<u8> = data[poa_chunk_num
* (context.testnet_config.chunk_size as usize)
..std::cmp::min(
(poa_chunk_num + 1) * (context.testnet_config.chunk_size as usize),
data.len(),
)]
.to_vec();
poa_test(
&context,
Expand All @@ -593,7 +599,7 @@ mod tests {
poa_tx_num,
poa_chunk_num,
2,
chunk_size,
context.testnet_config.chunk_size as usize,
)
.await;
}
Expand Down Expand Up @@ -622,6 +628,7 @@ mod tests {
context.storage_config.entropy_packing_iterations,
chunk_size,
&mut entropy_chunk,
context.storage_config.irys_chain_id,
);

xor_vec_u8_arrays_in_place(poa_chunk, &entropy_chunk);
Expand Down
Loading
Loading