-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: verfier and server #1
Conversation
.idea/greenfield-bsc-archiver.iml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we remove this Intellij IDE related file, as intelij is not a must for this project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -280,7 +280,7 @@ func (c *BundleClient) UploadObject(fileName, bucketName, bundleName, contentTyp | |||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When will be the method "func (c *BundleClient) UploadObject" used? Seemingly it is not being used now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, I use the function UploadAndFinalizeBundle(bundleName, bucketName, bundleDir, bundlePath string) to upload to Greenfield via the bundle service. This function is now obsolete and has been removed.
"stateRoot": "0x1db428ea79cb2e8cc233ae7f4db7c3567adfcb699af668a9f583fdae98e95588", | ||
"timestamp": "0x5f49ca59", | ||
"totalDifficulty": "0x3", | ||
"transactions": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example is too long, we dont have to show all of them. It can improve the readability of the readme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
2. eth_getBundledBlockByNumber | ||
3. eth_blockNumber | ||
4. eth_getBlockByHash | ||
5. /bsc/v1/blocks/{block_id}/bundle/name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: put the public endpoint of the service after deploy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the endpoint https://gnfd-bsc-archiver-testnet.bnbchain.org/ to the readme
@@ -1,14 +1,14 @@ | |||
{ | |||
"chain": "BSC", | |||
"bucket_name": "yourbucketname", | |||
"bucket_name": "bsc-historical-blocks-testnet-concurrency", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name concurrency
is unnecessary, user dont have to aware of this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to yourbucketname
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the .idea folder should be added to gitignore
Description
Rationale
The purpose of the
Greenfield BSC Archiver
is to store the headers and bodies of BSC historical blocks, and to upload the block information to Greenfield via the bundle service.The Syncer is responsible for retrieving block information through Ethereum calls, storing it in a database, and uploading it to Greenfield through the bundle service. The range of block heights uploaded can be customized; currently, it is set to 100 blocks.
The Verifier periodically verifies the correctness of the objects uploaded to Greenfield. If an error is detected, it updates and uploads the correct version of the object to the bundle service, and also updates the bundle name of the corresponding block in the local block database.
The Server provides RPC interfaces, with parameters currently adapted to Ethereum calls. Variables are customized and generated using a Swagger.yaml file.
Further Improvement
Currently, the process of retrieving block heights and storing them in the database is sequential, raising concerns that the high concurrency might overwhelm the bundle service. If the current version’s block tracking speed is slow, an update will be made to employ multiple workers to request and retrieve block heights into memory, and then collectively store them in both the bundle service and the database.
Example
Method: POST
URL: https://gnfd-bsc-archiver-testnet.bnbchain.org/
eth_getBlockByNumber
request
response