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

refactor: PoSt e2e test #699

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

refactor: PoSt e2e test #699

wants to merge 7 commits into from

Conversation

th7nder
Copy link
Contributor

@th7nder th7nder commented Jan 23, 2025

Description

Fixes #381, #615.
Removes hard-coded stuff from the maat and makes full e2e proving test work.

2025-01-24T13:14:56.672592Z DEBUG settle_deal_payments{address="5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y" deal_ids=[0]}: storagext::runtime::client: Waiting for finalization, Previous nonce: 10, next nonce: 11
[...]
2025-01-24T13:15:52.441372Z DEBUG subxt_core::events: Decoding Event 'System::ExtrinsicSuccess'
2025-01-24T13:15:52.441425Z DEBUG subxt_core::events: Decoding Event 'System::ExtrinsicSuccess'
2025-01-24T13:15:52.441477Z DEBUG subxt_core::events: Decoding Event 'System::ExtrinsicSuccess'
2025-01-24T13:15:52.441529Z DEBUG subxt_core::events: Decoding Event 'Balances::Withdraw'
2025-01-24T13:15:52.441585Z DEBUG subxt_core::events: Decoding Event 'Market::DealsSettled'
2025-01-24T13:15:52.441879Z DEBUG subxt_core::events: Decoding Event 'Balances::Deposit'
2025-01-24T13:15:52.441935Z DEBUG subxt_core::events: Decoding Event 'TransactionPayment::TransactionFeePaid'
2025-01-24T13:15:52.441993Z DEBUG subxt_core::events: Decoding Event 'System::ExtrinsicSuccess'
test real_world_use_case ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1312.74s

   Doc-tests maat

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Checklist

  • Make sure that you described what this change does.
  • Have you tested this solution?
  • Were there any alternative implementations considered?
  • Did you document new (or modified) APIs?

@th7nder th7nder changed the title refactor: move post into a deadline struct refactor: PoSt e2e test Jan 24, 2025
@th7nder th7nder marked this pull request as ready for review January 24, 2025 13:52
@th7nder th7nder self-assigned this Jan 24, 2025
@th7nder th7nder added bug Something isn't working enhancement New feature or request labels Jan 24, 2025
@th7nder th7nder linked an issue Jan 24, 2025 that may be closed by this pull request
@th7nder th7nder added ready for review Review is needed and removed ready for review Review is needed labels Jan 24, 2025
jmg-duarte
jmg-duarte previously approved these changes Jan 24, 2025
Copy link
Contributor

@jmg-duarte jmg-duarte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I have questions

Comment on lines 337 to 338
// collateral + pre_commit_deposit (1)
let balance = 12_500_000_001;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: you can expose the SP/Market function that defines the value and query it here
Or at least leave a note for one of us shmucks that will do that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note.

// submit_windowed_post(&client, &charlie_kp).await;
// in a network with no sectors, the 1st sector is always assigned to the 1st deadline (index: 0).
let deadline = Deadline::new(0, post_proof);
let sector_storage = |_sector_number| Some(sector.clone());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you making a clone, inside a closure, that doesn't even care for the argument it takes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SectorStorage: Fn(SectorNumber) -> Option<ProvenSector> -> is the trait bound.
So basically it means that the closure must be callable multiple times. Without the clone, sector_storage ends up being FnOnce, so a smaller guarantee thatn the Fn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request ready for review Review is needed
Projects
None yet
2 participants