Skip to content

Commit

Permalink
add block_number
Browse files Browse the repository at this point in the history
  • Loading branch information
YaroShkvorets committed Feb 22, 2024
1 parent af5516e commit 1a74a50
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion eth.blobs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ codegen:

.PHONE: package
package: build
substreams pack -o substreams.spkg substreams.yaml
substreams pack substreams.yaml

.PHONY: run
run: build
Expand Down
1 change: 1 addition & 0 deletions eth.blobs/proto/blobs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ message Blobs { repeated Blob blobs = 1; }
message Blob {
uint64 slot = 1;
google.protobuf.Timestamp timestamp = 2;
uint64 block_number = 3;
uint32 index = 11;
uint32 length = 12;
bytes data = 13;
Expand Down
5 changes: 3 additions & 2 deletions eth.blobs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ fn map_blobs(blk: BeaconBlock) -> Result<Blobs, substreams::errors::Error> {
Deneb(body) => body
.embedded_blobs
.into_iter()
.inspect(|_| substreams::log::info!("blk.timestamp: {}", blk.timestamp.clone().unwrap_or_default()))
// .inspect(|_| substreams::log::info!("blk.timestamp: {}", blk.timestamp.clone().unwrap_or_default()))
.map(|b| Blob {
slot: blk.slot,
timestamp: blk.timestamp.clone(),
timestamp: body.execution_payload.as_ref().cloned().unwrap_or_default().timestamp, // blk.timestamp.clone(),
block_number: body.execution_payload.as_ref().cloned().unwrap_or_default().block_number,
index: b.index as u32,
length: b.blob.len() as u32,
data: b.blob,
Expand Down
2 changes: 2 additions & 0 deletions eth.blobs/src/pb/eth.blobs.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub struct Blob {
pub slot: u64,
#[prost(message, optional, tag="2")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(uint64, tag="3")]
pub block_number: u64,
#[prost(uint32, tag="11")]
pub index: u32,
#[prost(uint32, tag="12")]
Expand Down

0 comments on commit 1a74a50

Please sign in to comment.