-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1227 from keep-network/no-two-entries
Do not allow to submit entry more than one time Operators were allowed to submit valid relay entry multiple times until the next relay request. This was wrong for at least two reasons: - Each new entry emits an event and application listening for those events may do some action on a new entry. - Each new entry submission costs some gas; in case two or more operators race for submitting a new entry, we should minimize the gas expenditure of losers. Two other minor changes in this PR: - Separated corrupted and invalid relay entry submission tests I had to import expectThrowWithMessage for the no-duplicate-entry unit test and couldn't help myself and had to refactor and split invalid entry test to use that import as well - Implemented isEntryInProgressFunction This function wraps currentEntryStartBlock != 0 condition. There is a negligible gas cost of having this function but it nicely describes what are we checking and we have cleaner code this way: - The relay request gas cost increased by 41 units. - The relay entry submission gas cost increased by 35 units. - The size of operator contract increased by 17 bytes.
- Loading branch information
Showing
2 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters