Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Conversation

@Ruteri
Copy link
Collaborator

@Ruteri Ruteri commented Dec 14, 2022

b.mu.Unlock()
}

timer.Reset(durationPerEpoch / 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the timer is not reset, wouldn't this loop only run once?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's a ticker it should be OK

@Ruteri Ruteri force-pushed the local-relay-fix-loop-setup branch from 946ea5e to 6c37398 Compare December 14, 2022 23:32
b.slotProposerMap = slotProposerMap
b.mu.Unlock()
nextFetchSlot := prevFetchSlot + b.slotsInEpoch/2
if currentSlot < nextFetchSlot {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if currentSlot < nextFetchSlot {
if currentSlot < nextFetchSlot || (currentSlot % b.slotsInEpoch) < b.slotsInEpoch/2 {

this works fine except that it requests the same validator map twice in the same epoch. Should only request it once.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is actually what we want - since we are trying to avoid corner cases where the BN is not ready with the proposers map for the next epoch (we can ask for what the BN thinks is epoch+2)

@Ruteri Ruteri force-pushed the local-relay-fix-loop-setup branch from 6c37398 to b7608fe Compare December 15, 2022 12:59
@avalonche avalonche merged commit 3782f2d into local-relay-fix Dec 15, 2022
avalonche added a commit that referenced this pull request Dec 20, 2022
* Fix getting validators map for local relay

* pr comments

* add timer for updating known validators

* improvement to local validator map fetching

* lock for map updating

* properly lock updates

* get current slot if the mapping is empty

* remove onForkchoiceUpdate

* graceful shutdown

* Split initial proposer sync from the proposer fetch loop (#28)

Co-authored-by: Mateusz Morusiewicz <[email protected]>
avalonche added a commit that referenced this pull request Feb 7, 2023
* Fix getting validators map for local relay

* pr comments

* add timer for updating known validators

* improvement to local validator map fetching

* lock for map updating

* properly lock updates

* get current slot if the mapping is empty

* remove onForkchoiceUpdate

* graceful shutdown

* Split initial proposer sync from the proposer fetch loop (#28)

Co-authored-by: Mateusz Morusiewicz <[email protected]>
avalonche added a commit that referenced this pull request Mar 9, 2023
* Fix getting validators map for local relay

* pr comments

* add timer for updating known validators

* improvement to local validator map fetching

* lock for map updating

* properly lock updates

* get current slot if the mapping is empty

* remove onForkchoiceUpdate

* graceful shutdown

* Split initial proposer sync from the proposer fetch loop (#28)

Co-authored-by: Mateusz Morusiewicz <[email protected]>
avalonche added a commit that referenced this pull request Mar 15, 2023
* Fix getting validators map for local relay

* pr comments

* add timer for updating known validators

* improvement to local validator map fetching

* lock for map updating

* properly lock updates

* get current slot if the mapping is empty

* remove onForkchoiceUpdate

* graceful shutdown

* Split initial proposer sync from the proposer fetch loop (#28)

Co-authored-by: Mateusz Morusiewicz <[email protected]>
avalonche added a commit that referenced this pull request Mar 17, 2023
* Fix getting validators map for local relay

* pr comments

* add timer for updating known validators

* improvement to local validator map fetching

* lock for map updating

* properly lock updates

* get current slot if the mapping is empty

* remove onForkchoiceUpdate

* graceful shutdown

* Split initial proposer sync from the proposer fetch loop (#28)

Co-authored-by: Mateusz Morusiewicz <[email protected]>
avalonche added a commit that referenced this pull request Mar 22, 2023
* Fix getting validators map for local relay

* pr comments

* add timer for updating known validators

* improvement to local validator map fetching

* lock for map updating

* properly lock updates

* get current slot if the mapping is empty

* remove onForkchoiceUpdate

* graceful shutdown

* Split initial proposer sync from the proposer fetch loop (#28)

Co-authored-by: Mateusz Morusiewicz <[email protected]>
avalonche added a commit that referenced this pull request Jul 6, 2023
* Fix getting validators map for local relay

* pr comments

* add timer for updating known validators

* improvement to local validator map fetching

* lock for map updating

* properly lock updates

* get current slot if the mapping is empty

* remove onForkchoiceUpdate

* graceful shutdown

* Split initial proposer sync from the proposer fetch loop (#28)

Co-authored-by: Mateusz Morusiewicz <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants