allow VP with no fee
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 33s Details

This commit is contained in:
Ladd Hoffman 2024-05-15 11:35:26 -05:00
parent d9479152da
commit f64eba070c
3 changed files with 6 additions and 5 deletions

View File

@ -121,6 +121,7 @@ contract Rollup is Availability {
/// If the batch worker fails to submit the batch, a new batch worker may be selected
function resetBatchWorker() public {
// TODO: Grace period after the current batch is due and before the worker can be replaced
require(
block.timestamp - batchStart > batchInterval,
"Current batch interval has not yet elapsed"
@ -131,7 +132,8 @@ contract Rollup is Availability {
block.timestamp - lastWorkerReset >= minResetInterval,
"Mininum reset interval has not elapsed since last batch worker reset"
);
// TODO: Should the current batch worker's availability stakes be forfeit?
// TODO: Submit a validation pool targeting a null post, and send the worker's availability stake
// This gives the DAO an opportunity to police the failed work
// Select a new batch worker
batchWorkerStakeIndex = assignWork();
batchWorker = stakes[batchWorkerStakeIndex].worker;

View File

@ -97,7 +97,6 @@ contract Bench {
msg.sender == address(dao),
"Only DAO contract may call initiateValidationPool"
);
require(msg.value > 0, "Fee is required to initiate validation pool");
require(duration >= minDuration, "Duration is too short");
require(duration <= maxDuration, "Duration is too long");
require(
@ -124,7 +123,7 @@ contract Bench {
// We use our privilege as the DAO contract to mint reputation in proportion with the fee.
// Here we assume a minting ratio of 1
// TODO: Make minting ratio an adjustable parameter
dao.mint(address(dao), msg.value);
dao.mint(address(dao), pool.props.fee);
pool.props.minted = msg.value;
dao.emitValidationPoolInitiated(poolIndex);
}

View File

@ -52,9 +52,9 @@ describe('Validation Pools', () => {
});
describe('Initiate', () => {
it('should not be able to initiate a validation pool without a fee', async () => {
it('should be able to initiate a validation pool without a fee', async () => {
const init = () => initiateValidationPool({ fee: 0 });
await expect(init()).to.be.revertedWith('Fee is required to initiate validation pool');
await expect(init()).to.emit(dao, 'ValidationPoolInitiated');
});
it('should not be able to initiate a validation pool with a quorum below the minimum', async () => {