-
Notifications
You must be signed in to change notification settings - Fork 5.2k
feat(pages/resources): add pectra countdown and blobscan api #15324
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
base: dev
Are you sure you want to change the base?
feat(pages/resources): add pectra countdown and blobscan api #15324
Conversation
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Comments for @pettinarip and @wackerow here. The formatted values of the two numbers don't seem right to me. 😅 I had to remove the "billion" abbreviation from the formatted "Average blob fee".
const ethPrice = useEthPrice() | ||
const avgBlobFeeUsd = formatSmallUSD( | ||
// Converting value from gwei to USD | ||
avgBlobFee * 1e-9 * ethPrice, | ||
localeForNumberFormat | ||
).replace(/[A-Za-z]$/, "") | ||
|
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.
I double-checked in a converter, and this value should be correct, returning $2.4
here.
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.
Hey @TylerAPfledderer I think that the problem is that avgBlobFee
is in wei, not gwei. That is why we get it in billions. So, if we do
const ethPrice = useEthPrice() | |
const avgBlobFeeUsd = formatSmallUSD( | |
// Converting value from gwei to USD | |
avgBlobFee * 1e-9 * ethPrice, | |
localeForNumberFormat | |
).replace(/[A-Za-z]$/, "") | |
const ethPrice = useEthPrice() | |
const avgBlobFeeUsd = formatSmallUSD( | |
// Converting value from wei to USD | |
avgBlobFee * 1e-18 * ethPrice, | |
localeForNumberFormat | |
) |
we shouldn't need to replace anything.
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.
@pettinarip ah, that did it! Pushed the change 😄
<div className="text-sm">Next upgrade</div> | ||
<div className="text-5xl font-bold">Pectra</div> | ||
{/* TODO: Convert date to a countdown */} | ||
<div className="text-xl font-bold text-body-medium">07 May 2025</div> |
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.
Any suggestions on which way to go here? Kinda already doing an approach in useResources
for "Time to next block". Use that approach for this?
There is also something more robust like the react-countdown component if this is to used again for something else.
@TylerAPfledderer, did you manage to see why the page doesn't load? https://deploy-preview-15324--ethereumorg.netlify.app/en/resources/ |
I'm not able to check this. Everything works fine in local dev, and when attempting to build locally, I have issues getting the build to complete successfully for unrelated reasons. I can try that again today |
nice, thank you! |
@nloureiro apologies for the delay. I am still not able to recreate the problem locally. When I attempt to run the build locally, I still get unrelated errors that prevent the build from completing. @pettinarip @wackerow any input here with the resource not working through the deploy link? |
@TylerAPfledderer sorry about this. Here is the error log The problem is coming from the dataloader layer. In preview deploy envs, we are using mocked data by default, and the loader is failing to load that mocked data because it doesn't exist. You can find these files in https://github.com/ethereum/ethereum-org-website/tree/dev/src/data/mocks I'll add a new json file to provide the response for the new query we're making in this PR. That should resolve the issue. |
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.
added this file. If you run with USE_MOCK_DATA=true
this will be used
notation: "compact", | ||
minimumSignificantDigits: 2, | ||
maximumSignificantDigits: 2, |
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.
Simplify the price formatting for formatSmallUSD()
, so that two decimal places are always shown, no matter the number of significant figures. (i.e. $xx.xx
versus $x.xx
)
@pettinarip @nloureiro should be all set here. Since the Pectra Upgrade should already be live at this point (May 7th 2025) then the "Live" tag is rendered, but I still set up the countdown for any future upgrade that might be added here. |
// TODO: Add metric | ||
metric: ( | ||
<div className="grid place-items-center py-5"> | ||
<div className="text-sm">Next upgrade</div> |
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.
@TylerAPfledderer from my end we just need to change this details to "Latest upgrade" because it's live now
This issue is stale because it has been open 30 days with no activity. |
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.
Thanks a lot @TylerAPfledderer! Sorry for delays here, pulling in
Ah spoke too soon, forgot this got refactored to server-side without hooks. Will need to refactor this a bit |
Description
In the resource page section "Scaling Ethereum" add the date for the
Pectra
upgrade, and show total blobs and average blob fee.Related Issue
Closes #15219