codex-storage / codex-contracts-eth

Ethereum smart contracts for Codex
Other
6 stars 9 forks source link

Remove unneeded `_probabilities`? #137

Open emizzle opened 1 month ago

emizzle commented 1 month ago

When a slot is filled, the proof probability is stored in a private mapping _probabilities. However, this is likely not needed as the proof probability for a Request is already stored in Request.Ask.

This may require passing in the request Id.

AuHau commented 1 month ago

Yeah, seems like it is not needed.

markspanbroek commented 4 weeks ago

Good idea. The mapping is currently used to to decouple Proofs.sol from needing to know about requests. But we might as well use a virtual function slotProbability(SlotId) for that, analogous to how we handle slot state: https://github.com/codex-storage/codex-contracts-eth/blob/fe8da1013d3b1270b3063147d8eb51550bd50f9c/contracts/Proofs.sol#L36