Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: avichalp <[email protected]>
  • Loading branch information
avichalp committed Feb 19, 2025
1 parent 8dbf155 commit dc24be1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
10 changes: 1 addition & 9 deletions fendermint/actors/blobs/src/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,8 @@ impl BlobsActor {
/// This is called by the system actor every X blocks, where X is set in the recall config actor.
/// TODO: Take a start key and page limit to avoid out-of-gas errors.
fn debit_accounts(rt: &impl Runtime) -> Result<(), ActorError> {
// rt.validate_immediate_caller_is(std::iter::once(&SYSTEM_ACTOR_ADDR))?;
rt.validate_immediate_caller_accept_any()?;
rt.validate_immediate_caller_is(std::iter::once(&SYSTEM_ACTOR_ADDR))?;
let config = get_config(rt)?;

let mut credit_debited = Credit::zero();
let (deletes, num_accounts) = rt.transaction(|st: &mut State, rt| {
let initial_credit_debited = st.credit_debited.clone();
Expand Down Expand Up @@ -1375,12 +1373,6 @@ mod tests {
assert!(result.is_ok());
rt.verify();

// After funding the account, commit credits for storage
rt.set_caller(*ETHACCOUNT_ACTOR_CODE_ID, id_addr);
rt.expect_validate_caller_any();
expect_get_config(&rt);

// Then add blobs...
rt.set_epoch(ChainEpoch::from(5));
rt.expect_validate_caller_any();
expect_get_config(&rt);
Expand Down
4 changes: 2 additions & 2 deletions fendermint/actors/recall_config/shared/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ impl Default for RecallConfig {
blob_credit_debit_interval: ChainEpoch::from(60 * 10), // ~10 min
blob_min_ttl: ChainEpoch::from(60 * 60), // ~1 hour
blob_default_ttl: ChainEpoch::from(60 * 60 * 24), // ~1 day
blob_delete_batch_size: 150, // Default from previous hardcoded value
account_debit_batch_size: 2000, // Default from previous hardcoded value
blob_delete_batch_size: 150,
account_debit_batch_size: 2000,
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions fendermint/actors/recall_config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@ impl Actor {
"default TTL must be greater than or equal to minimum TTL"
));
}
if params.blob_delete_batch_size <= 0 {
return Err(actor_error!(
illegal_argument,
"blob delete batch size must be positive"
));
}
if params.account_debit_batch_size <= 0 {
return Err(actor_error!(
illegal_argument,
"account debit batch size must be positive"
));
}

let (admin_id_addr, admin_delegated_addr) = if !admin_exists {
// The first caller becomes admin
Expand Down
2 changes: 1 addition & 1 deletion fendermint/vm/interpreter/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ where
gas_limit = gas_limit,
gas_used = apply_ret.msg_receipt.gas_used,
info = info.unwrap_or_default(),
"====>>>> implicit tx delivered"
"implicit tx delivered"
);
tracing::debug!("chain interpreter debited accounts");

Expand Down

0 comments on commit dc24be1

Please sign in to comment.