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

Fix p2p header adapters #2127

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ feedernode: juno-cached
--metrics-port=9090

node1: juno-cached
# todo remove rm before merge
rm -rf ./p2p-dbs/node1/ && \
./build/juno \
--network=sepolia \
--log-level=debug \
Expand Down
7 changes: 3 additions & 4 deletions adapters/core2p2p/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,15 @@ func AdaptHeader(header *core.Header, commitments *core.BlockCommitments,
NLeaves: header.EventCount,
Root: AdaptHash(commitments.EventCommitment),
},
// todo fill receipts with receipt commitment
Receipts: AdaptHash(&felt.Zero),
Receipts: AdaptHash(commitments.ReceiptCommitment),
ProtocolVersion: header.ProtocolVersion,
GasPriceFri: AdaptUint128(header.GasPrice),
GasPriceFri: AdaptUint128(header.GasPriceSTRK),
Signatures: utils.Map(header.Signatures, AdaptSignature),
StateDiffCommitment: &spec.StateDiffCommitment{
StateDiffLength: stateDiffLength,
Root: AdaptHash(stateDiffCommitment),
},
GasPriceWei: AdaptUint128(header.GasPriceSTRK),
GasPriceWei: AdaptUint128(header.GasPrice),
DataGasPriceFri: AdaptUint128(header.L1DataGasPrice.PriceInFri),
DataGasPriceWei: AdaptUint128(header.L1DataGasPrice.PriceInWei),
L1DataAvailabilityMode: adaptL1DA(header.L1DAMode),
Expand Down
1 change: 0 additions & 1 deletion adapters/p2p2core/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func AdaptBlockHeader(h *spec.SignedBlockHeader, eventsBloom *bloom.BloomFilter)
PriceInWei: AdaptUint128(h.DataGasPriceWei),
PriceInFri: AdaptUint128(h.DataGasPriceFri),
},
// todo(kirill) check prices
GasPrice: AdaptUint128(h.GasPriceWei),
GasPriceSTRK: AdaptUint128(h.GasPriceFri),
}
Expand Down
2 changes: 1 addition & 1 deletion p2p/starknet/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (h *Handler) onHeadersRequest(req *spec.BlockHeadersRequest) (iter.Seq[prot

return &spec.BlockHeadersResponse{
HeaderMessage: &spec.BlockHeadersResponse_Header{
Header: core2p2p.AdaptHeader(header, commitments, stateUpdate.StateDiff.Commitment(),
Header: core2p2p.AdaptHeader(header, commitments, stateUpdate.StateDiff.Hash(),
stateUpdate.StateDiff.Length()),
},
}, nil
Expand Down
Loading