Skip to content
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

Update algorithm to remove need for loops #24

Merged
merged 9 commits into from
Jul 16, 2021
Merged

Update algorithm to remove need for loops #24

merged 9 commits into from
Jul 16, 2021

Conversation

LayneHaber
Copy link
Contributor

@LayneHaber LayneHaber commented Jul 14, 2021

Fixes c4 issue numbers:

  • 27
  • 24

@sanchaymittal
Copy link
Collaborator

sanchaymittal commented Jul 14, 2021

A bit unclear why are we using three mappings to track the active block number.

Can we do this:

  /// @dev Number of transactions in the block for that user.
  /// user -> block -> number of prepare transactions in a single block
 mapping(address => mapping(uint256 => uint256))  public activeTransactionBlocks;

function prepare(){
...
 activeTransactionBlocks[user][block.number] += 1;
...
}

// removing active blocks
require(activeTransactionBlocks[user][preparedBlock] > 0, "removeUserActiveBlocks: NONE");
activeTransactionBlocks[user][preparedBlock] -= 1;

@LayneHaber LayneHaber merged commit 30238ec into main Jul 16, 2021
@LayneHaber LayneHaber deleted the c4-27 branch July 22, 2021 00:20
sanchaymittal pushed a commit that referenced this pull request Oct 18, 2023
* feat: removing lint (#10)

* feat:  root manager new variables (#8)

* feat: adding new variables (#7)

* refactor: root manager finalize function (#11)

* refactor: root manager dequeue function (#15)

* feat: adding optimistic mode to spoke (#12)

* refactor: unify propagate

* refactor: remove deprecated variable (#18)

* feat: introduce last count check again (#20)

* feat:optimistic mode guards (#19)

* feat: guard propagation of root zero (#21)

* feat: changing constructor params to struct (#23)

* feat: added guard for pause to op functions (#25)

* feat: adding whenNotPaused modifier to propose and finalize (#24)

* chore: remove unnecesary setup functions on tests (#26)

* fix: event natspec (#28)

* refactor: remove lastCountBeforeOpMode variable (#29)

* fix: natspec (#31)

* fix: removing optimistic mode guard from send (#30)

* feat: agg root direct save on hub spoke

* feat: adding natspec

* fix: typo

* test: convention fixes

* docs: natspec typo

* docs: natspect typos

* refactor: mainnet spoke imports

* feat: saveAggregateRoot delentes pending root if exists

* test: adding pending root deletion test

* chore: root manager tests comments

* feat: dispute blocks constructor check [L-1]  (#35)

* feat: fixing comment [Q-4] (#38)

* feat: removing unused events and errors [Q-2] (#39)

* feat: unifying save aggregate root events [Q-3] (#40)

* feat: delete pending root on propose (#34)

* feat: external for public [Q-1] (#36)

---------

Co-authored-by: 0xng <87835144+0xng@users.noreply.github.com>
Co-authored-by: 0xng <ng@defi.sucks>
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.

3 participants