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

Implement subscribeNewHeads,subscriptionReorg,subscribePendingTransactions #2211

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

weiihann
Copy link
Contributor

@weiihann weiihann commented Oct 11, 2024

Description

Fixes #2205
Fixes #2207
Fixes #2232

The difference between the previous implementation of juno_subscribeNewHeads is that it supports streaming historical block headers up to 1024 blocks ago, as per the specification.

rpc/events.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 76.47059% with 64 lines in your changes missing coverage. Please review.

Project coverage is 75.56%. Comparing base (3093ca8) to head (a4cc367).

Files with missing lines Patch % Lines
rpc/events.go 73.17% 40 Missing and 15 partials ⚠️
jsonrpc/server.go 66.66% 4 Missing and 1 partial ⚠️
sync/sync.go 87.09% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2211      +/-   ##
==========================================
- Coverage   75.63%   75.56%   -0.08%     
==========================================
  Files         104      105       +1     
  Lines       11102    11344     +242     
==========================================
+ Hits         8397     8572     +175     
- Misses       2073     2123      +50     
- Partials      632      649      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pnowosie pnowosie self-requested a review October 11, 2024 12:02
@weiihann weiihann force-pushed the weiihann/2205-subscribeNewHeads branch 2 times, most recently from a84cbfd to 24d8885 Compare October 14, 2024 09:26
@weiihann weiihann changed the title Implements starknet_subscribeNewHeads and starknet_subscriptionNewHeads Implements starknet_subscribeNewHeads Oct 14, 2024
@weiihann weiihann force-pushed the weiihann/2205-subscribeNewHeads branch from f01671a to fcd5e8f Compare October 15, 2024 09:43
@weiihann weiihann changed the title Implements starknet_subscribeNewHeads Implements starknet_subscribeNewHeads and starknet_subscriptionReorg Oct 15, 2024
@weiihann weiihann force-pushed the weiihann/2205-subscribeNewHeads branch 2 times, most recently from eaea8ce to e7ccc0a Compare October 21, 2024 16:58
@weiihann weiihann changed the title Implements starknet_subscribeNewHeads and starknet_subscriptionReorg Implement starknet_subscribeNewHeads,starknet_subscriptionReorg,starknet_subscribePendingTransactions Oct 21, 2024
@weiihann weiihann force-pushed the weiihann/2205-subscribeNewHeads branch from e7ccc0a to 8efccc0 Compare October 21, 2024 17:01
@pnowosie pnowosie force-pushed the weiihann/2205-subscribeNewHeads branch from 8efccc0 to 19641b8 Compare October 23, 2024 12:16
jsonrpc/server.go Show resolved Hide resolved
EndBlockNum: head.Number,
}
} else { // not the first block of the reorg, adjust the starting block
s.currReorg.StartBlockHash = localHead
Copy link
Contributor

Choose a reason for hiding this comment

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

So we're reverting backwards, so previously set head.Number > currently reverted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you explain further? I didn't get what you meant.

@weiihann weiihann changed the title Implement starknet_subscribeNewHeads,starknet_subscriptionReorg,starknet_subscribePendingTransactions Implement subscribeNewHeads,subscriptionReorg,subscribePendingTransactions Oct 25, 2024
@weiihann weiihann force-pushed the weiihann/2205-subscribeNewHeads branch from c680bbf to e3b5e9b Compare October 25, 2024 11:06
@weiihann weiihann force-pushed the weiihann/2205-subscribeNewHeads branch from c84636c to a4cc367 Compare October 29, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants