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

New notifier #3505

Merged
merged 12 commits into from
Oct 14, 2021
Merged

New notifier #3505

merged 12 commits into from
Oct 14, 2021

Conversation

0xmtf
Copy link
Contributor

@0xmtf 0xmtf commented Oct 12, 2021

  • integrated new functionality in OutportDriver for the FinalizedBlock operation.
  • integrated the new go notifier implementation

@codecov
Copy link

codecov bot commented Oct 12, 2021

Codecov Report

Merging #3505 (ae292a4) into development (a612cd5) will increase coverage by 0.00%.
The diff coverage is 90.90%.

Impacted file tree graph

@@             Coverage Diff              @@
##           development    #3505   +/-   ##
============================================
  Coverage        73.87%   73.87%           
============================================
  Files              582      582           
  Lines            74521    74532   +11     
============================================
+ Hits             55050    55064   +14     
+ Misses           15066    15065    -1     
+ Partials          4405     4403    -2     
Impacted Files Coverage Δ
process/block/metablock.go 55.10% <0.00%> (-0.04%) ⬇️
factory/statusComponents.go 74.82% <100.00%> (+0.17%) ⬆️
outport/outport.go 100.00% <100.00%> (ø)
process/block/baseProcess.go 68.71% <100.00%> (+0.37%) ⬆️
process/block/shardblock.go 66.66% <100.00%> (+0.02%) ⬆️
...ataRetriever/dataPool/headersCache/headersCache.go 79.54% <0.00%> (+1.51%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2c71aa...ae292a4. Read the comment docs.

@0xmtf 0xmtf marked this pull request as ready for review October 12, 2021 14:41
@iulianpascalau iulianpascalau added the type:feature New feature or request label Oct 13, 2021
bogdan-rosianu
bogdan-rosianu previously approved these changes Oct 13, 2021
@@ -84,6 +84,16 @@ func (o *outport) SaveAccounts(blockTimestamp uint64, acc []data.UserAccountHand
}
}

// FinalizedBlock will call whenever a block is finalized
func (o *outport) FinalizedBlock(headerHash []byte) {
Copy link
Contributor

Choose a reason for hiding this comment

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

will be called / will call all the drivers

Copy link
Contributor

Choose a reason for hiding this comment

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

done

@@ -1087,6 +1087,22 @@ func getLastSelfNotarizedHeaderByItself(chainHandler data.ChainHandler) (data.He
return currentHeader, currentBlockHash
}

func (bp *baseProcessor) setFinalizedBlockInIndexer(hdr data.HeaderHandler) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove L1091 - L1099 and change the method parameter to hdrHash []byte as you already have in the caller side the header hash and there is no need to recalculate it here

Copy link
Contributor

Choose a reason for hiding this comment

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

right

@@ -1392,6 +1392,8 @@ func (mp *metaProcessor) updateState(lastMetaBlock data.HeaderHandler) {
mp.accountsDB[state.PeerAccountsState],
mp.peerStatePruningQueue,
)

mp.setFinalizedBlockInIndexer(prevHeader)
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace prevHeader with lastMetaBlock.GetPrevHash()

Copy link
Contributor

Choose a reason for hiding this comment

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

done

@@ -1044,6 +1044,8 @@ func (sp *shardProcessor) updateState(headers []data.HeaderHandler, currentHeade
sp.accountsDB[state.UserAccountsState],
sp.userStatePruningQueue,
)

sp.setFinalizedBlockInIndexer(prevHeader)
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace prevHeader with hdr.GetPrevHash()

Copy link
Contributor

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

@gabi-vuls gabi-vuls left a comment

Choose a reason for hiding this comment

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

System test passed.
image

@iulianpascalau iulianpascalau merged commit 945f104 into development Oct 14, 2021
@iulianpascalau iulianpascalau deleted the new-notifier branch October 14, 2021 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants