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

plumb some rent #5610

Merged
merged 5 commits into from
Aug 23, 2019
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
6 changes: 4 additions & 2 deletions core/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,8 @@ pub mod tests {
"owner": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
"lamports": 20,
"data": [],
"executable": false
"executable": false,
"rent_epoch": 0
},
"id":1}
"#;
Expand Down Expand Up @@ -903,7 +904,8 @@ pub mod tests {
"owner": {:?},
"lamports": 20,
"data": [],
"executable": false
"executable": false,
"rent_epoch": 0
}}]],
"id":1}}
"#,
Expand Down
4 changes: 3 additions & 1 deletion core/src/rpc_pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ mod tests {
"owner": budget_program_id,
"lamports": 51,
"data": expected_data,
"executable": executable,
"executable": executable,
"rent_epoch": 0,
},
"subscription": 0,
}
Expand Down Expand Up @@ -574,6 +575,7 @@ mod tests {
"lamports": 100,
"data": [],
"executable": false,
"rent_epoch": 0,
},
"subscription": 0,
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/rpc_subscriptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ mod tests {
subscriptions.check_account(&alice.pubkey(), 0, &bank_forks);
let string = transport_receiver.poll();
if let Async::Ready(Some(response)) = string.unwrap() {
let expected = format!(r#"{{"jsonrpc":"2.0","method":"accountNotification","params":{{"result":{{"data":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"executable":false,"lamports":1,"owner":[2,203,81,223,225,24,34,35,203,214,138,130,144,208,35,77,63,16,87,51,47,198,115,123,98,188,19,160,0,0,0,0]}},"subscription":0}}}}"#);
let expected = format!(r#"{{"jsonrpc":"2.0","method":"accountNotification","params":{{"result":{{"data":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"executable":false,"lamports":1,"owner":[2,203,81,223,225,24,34,35,203,214,138,130,144,208,35,77,63,16,87,51,47,198,115,123,98,188,19,160,0,0,0,0],"rent_epoch":0}},"subscription":0}}}}"#);
assert_eq!(expected, response);
}

Expand Down Expand Up @@ -403,7 +403,7 @@ mod tests {
subscriptions.check_program(&solana_budget_api::id(), 0, &bank_forks);
let string = transport_receiver.poll();
if let Async::Ready(Some(response)) = string.unwrap() {
let expected = format!(r#"{{"jsonrpc":"2.0","method":"programNotification","params":{{"result":["{:?}",{{"data":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"executable":false,"lamports":1,"owner":[2,203,81,223,225,24,34,35,203,214,138,130,144,208,35,77,63,16,87,51,47,198,115,123,98,188,19,160,0,0,0,0]}}],"subscription":0}}}}"#, alice.pubkey());
let expected = format!(r#"{{"jsonrpc":"2.0","method":"programNotification","params":{{"result":["{:?}",{{"data":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"executable":false,"lamports":1,"owner":[2,203,81,223,225,24,34,35,203,214,138,130,144,208,35,77,63,16,87,51,47,198,115,123,98,188,19,160,0,0,0,0],"rent_epoch":0}}],"subscription":0}}}}"#, alice.pubkey());
assert_eq!(expected, response);
}

Expand Down
13 changes: 13 additions & 0 deletions genesis/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use solana_sdk::genesis_block::Builder;
use solana_sdk::hash::{hash, Hash};
use solana_sdk::poh_config::PohConfig;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::rent::Rent;
use solana_sdk::signature::{read_keypair, Keypair, KeypairUtil};
use solana_sdk::system_program;
use solana_sdk::timing;
Expand Down Expand Up @@ -59,6 +60,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
let default_target_lamports_per_signature = &FeeCalculator::default()
.target_lamports_per_signature
.to_string();
let default_lamports_per_byte_year = &Rent::default().lamports_per_byte_year.to_string();
let default_target_signatures_per_slot = &FeeCalculator::default()
.target_signatures_per_slot
.to_string();
Expand Down Expand Up @@ -161,6 +163,17 @@ fn main() -> Result<(), Box<dyn error::Error>> {
verification when the cluster is operating at target-signatures-per-slot",
),
)
.arg(
Arg::with_name("lamports_per_byte_year")
.long("lamports-per-byte-year")
.value_name("LAMPORTS")
.takes_value(true)
.default_value(default_lamports_per_byte_year)
.help(
"The cost in lamports that the cluster will charge per byte per year \
for accounts with data.",
),
)
.arg(
Arg::with_name("target_signatures_per_slot")
.long("target-signatures-per-slot")
Expand Down
5 changes: 2 additions & 3 deletions programs/move_loader_api/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,17 +760,16 @@ mod tests {
lamports: 1,
data: bincode::serialize(&LibraAccountState::create_unallocated()).unwrap(),
owner: id(),
executable: false,
..Account::default()
};
Self::new(key, account)
}

pub fn create_genesis(amount: u64) -> Self {
let account = Account {
lamports: 1,
data: vec![],
owner: id(),
executable: false,
..Account::default()
};
let mut genesis = Self::new(Pubkey::default(), account);
genesis.account.data =
Expand Down
4 changes: 1 addition & 3 deletions programs/storage_api/src/storage_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,8 @@ mod tests {
let mut account = StorageAccount {
id: Pubkey::default(),
account: &mut Account {
lamports: 0,
data: vec![],
owner: id(),
executable: false,
..Account::default()
},
};
let segment_index = 0;
Expand Down
Loading