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

Remove unused root history #23

Merged
merged 1 commit into from
Aug 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions contracts/anchors/bridged/AnchorPoseidon2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ abstract contract AnchorPoseidon2 is MerkleTreePoseidon, ReentrancyGuard {

IVerifier public immutable verifier;
uint256 public immutable denomination;

uint256 public immutable chainID;

struct Edge {
uint256 chainID;
bytes32 root;
Expand All @@ -47,8 +47,6 @@ abstract contract AnchorPoseidon2 is MerkleTreePoseidon, ReentrancyGuard {
// map to store all commitments to prevent accidental deposits with the same commitment
mapping(bytes32 => bool) public commitments;

// map to store the history of root updates
mapping(uint => bytes32[]) public rootHistory;

// the latest history index that represents the next index to store history
uint latestHistoryIndex;
Expand Down Expand Up @@ -81,8 +79,6 @@ abstract contract AnchorPoseidon2 is MerkleTreePoseidon, ReentrancyGuard {
denomination = _denomination;
chainID = _chainID;
latestHistoryIndex = 0;
// TODO: Parameterize max roots (length of array should be max roots)
rootHistory[latestHistoryIndex] = new bytes32[](1);
}

/**
Expand Down