-
Notifications
You must be signed in to change notification settings - Fork 1
Enforce fair FIFO queue ordering on-chain #46
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
base: main
Are you sure you want to change the base?
Conversation
ebe63d0 to
8ad764e
Compare
9a20c8f to
5717ad2
Compare
74c948d to
371f132
Compare
Code Review: Enforce Fair FIFO Queue Ordering On-ChainSummaryThis PR successfully addresses the FIFO fairness issue by removing the ✅ Strengths
🔴 Critical Issues1. Bug in
|
71b9aeb to
9d7d107
Compare
Closes #25
FLOW-10: FIFO Queue Is Not Enforced on-Chain yet Costs O(n) to Maintain
startProcessing()&completeProcessing()currently accept the request ID to process next. This is the API which allows the authorized COA to by-pass FIFO fairness on-chain, by ignoring what is the next request ID in line onpendingRequestIdsarray.To avoid this, we remove the
requestIdparameter from these 2 methods, and simply rely on the contract's internal state, to pick up the next request ID in line, for processing. This allows us to guarantee FIFO fairness on-chain. We also introduce a more optimized queue data structures (mapping-based), to avoid the high gas costs of maintaining the FIFO order on-chain.