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

Add Blob column to website #576

Merged
merged 6 commits into from
Feb 1, 2024
Merged

Add Blob column to website #576

merged 6 commits into from
Feb 1, 2024

Conversation

avalonche
Copy link
Collaborator

📝 Summary

Adds a blob column to the website to show the number of blobs in the block. On hover will also indicate the amount of blob gas used. Also some refactoring of the block validation json marshalling.

Deployed on goerli.

Screenshot 2024-01-30 at 4 13 07 pm

⛱ Motivation and Context

Allows easy monitoring of blobs in blocks.

📚 References

See also flashbots/relay-specs#31 for exposing the same data on the data API. These changes will allow the same information easily exposed to the data API.


✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2024

Codecov Report

Attention: 89 lines in your changes are missing coverage. Please review.

Comparison is base (72fab1a) 36.49% compared to head (52e5094) 36.22%.

Files Patch % Lines
common/types.go 0.00% 42 Missing ⚠️
common/types_spec.go 0.00% 20 Missing ⚠️
database/database.go 65.38% 9 Missing ⚠️
common/utils.go 61.53% 4 Missing and 1 partial ⚠️
services/api/service.go 90.24% 2 Missing and 2 partials ⚠️
database/mockdb.go 0.00% 3 Missing ⚠️
datastore/redis.go 88.23% 2 Missing ⚠️
services/api/utils.go 0.00% 0 Missing and 2 partials ⚠️
common/test_utils.go 0.00% 1 Missing ⚠️
services/api/blocksim_ratelimiter.go 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #576      +/-   ##
==========================================
- Coverage   36.49%   36.22%   -0.27%     
==========================================
  Files          24       24              
  Lines        5237     5267      +30     
==========================================
- Hits         1911     1908       -3     
- Misses       3073     3112      +39     
+ Partials      253      247       -6     
Flag Coverage Δ
unittests 36.22% <47.33%> (-0.27%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Base automatically changed from deneb to main January 30, 2024 18:14
@metachris
Copy link
Collaborator

V cool! Please rebase.

Wonder if we should slim down the column title from "Num blobs" to only "Blobs". I think yes.

replace website etherscan url with svg
@@ -326,25 +326,93 @@ func (b *BidTraceV2WithTimestampJSON) ToCSVRecord() []string {
}
}

type BidTraceV2WithBlobFields struct {
builderApiV1.BidTrace
Copy link
Collaborator

Choose a reason for hiding this comment

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

could extend V2

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This would expose the blob data to the data api as it uses the same json structs

ExcessBlobGas uint64 `json:"excess_blob_gas,string"`
}

func (b BidTraceV2WithBlobFields) MarshalJSON() ([]byte, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why does it need custom marshal and unmarshal functions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The bid trace is an embedded struct and json.Marshal does not marshal properly for embedded structs.

type BlockSubmissionInfo struct {
BidTrace *builderApiV1.BidTrace
Slot uint64
Copy link
Collaborator

Choose a reason for hiding this comment

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

why remove this and other info fields?

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh i see, because it's already inside BidTrace

ExecutionPayloadBlockHash phase0.Hash32
ExecutionPayloadParentHash phase0.Hash32
Builder phase0.BLSPubKey
Proposer phase0.BLSPubKey
ProposerFeeRecipient bellatrix.ExecutionAddress
GasUsed uint64
Copy link
Collaborator

Choose a reason for hiding this comment

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

GasUsed and GasLimnit is also part of BidTrace

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The fields are using the gas used and gas limit from the execution payload

Copy link
Collaborator

@metachris metachris left a comment

Choose a reason for hiding this comment

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

nice work! left a few questions, overall lgtm!

@avalonche avalonche merged commit d8a0d7b into main Feb 1, 2024
4 checks passed
@avalonche avalonche deleted the deneb-website-blobs branch February 1, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants