Skip to content

Conversation

@markspanbroek
Copy link
Contributor

@markspanbroek markspanbroek commented Jun 5, 2025

Previously we used request.expiry as the block expiry, but the former is a duration in seconds, whereas the latter is a timestamp.

  • Slot queue items can now either contain an expiry (when they represent a newly created request) or not contain an expiry (when they represent a recently freed slot that need repairing)
  • Slot queue items are now added to the sales agent state, so that they can be re-added easily, instead of having to recreate the slot queue item from on-chain state.

Extracted the fix from #1196

@benbierens
Copy link
Contributor

Commit sha-6e55e37 passes the release tests.

Previously we used request.expiry as the block expiry,
but the former is a duration in seconds, whereas the
latter is a timestamp
@markspanbroek markspanbroek force-pushed the fix-marketplace-block-expiry branch from ddea7c4 to 2036e23 Compare June 11, 2025 09:54
@markspanbroek markspanbroek marked this pull request as ready for review June 11, 2025 10:04
Copy link
Contributor

@AuHau AuHau left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this!

Was looking where mistake was made and it was mine 😅 So thanks for patching this!

trace "Retrieving expiry"
var expiry: SecondsSince1970
if state =? requestState and state == RequestState.Started:
expiry = await market.getRequestEnd(requestId)
Copy link
Contributor

Choose a reason for hiding this comment

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

Upon the filled state, this will get "re-updated" to the same value, but I guess it is not a problem except a bit of wasted CPU cycles.

StorageRequested(
requestId: request.id,
ask: request.ask,
expiry: market.requestExpiry[request.id].uint64,
Copy link
Contributor

Choose a reason for hiding this comment

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

Here the expiry should be the duration no ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh no sorry, it is ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's really confusing keeping these two uint64 values apart, so that's why in #1196 I created different types for durations and timestamps. But I didn't want to extract all of that into this PR.

Copy link
Contributor

@2-towns 2-towns left a comment

Choose a reason for hiding this comment

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

LGTM

@markspanbroek markspanbroek enabled auto-merge June 11, 2025 10:57
@markspanbroek markspanbroek added this pull request to the merge queue Jun 11, 2025
Merged via the queue into master with commit 27d807a Jun 11, 2025
18 checks passed
@markspanbroek markspanbroek deleted the fix-marketplace-block-expiry branch June 11, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants