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

attributes publisher #4

Merged
merged 29 commits into from
Aug 14, 2024
Merged

attributes publisher #4

merged 29 commits into from
Aug 14, 2024

Conversation

jinmel
Copy link

@jinmel jinmel commented Jul 1, 2024

No description provided.

Copy link
Member

@dmarzzz dmarzzz left a comment

Choose a reason for hiding this comment

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

should this be behind a flag?

@dmarzzz
Copy link
Member

dmarzzz commented Jul 6, 2024

also can we make sure we match L1 payload attribute SSE stream as closely as possible? ethereum/beacon-APIs#244

Copy link

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jul 31, 2024
@github-actions github-actions bot removed the Stale label Aug 2, 2024

mux := http.NewServeMux()
mux.HandleFunc("/events", eventStream.HTTPHandler)
addr := net.JoinHostPort(cfg.RPC.ListenAddr, strconv.Itoa(cfg.RPC.ListenPort+1))
Copy link
Collaborator

Choose a reason for hiding this comment

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

can the rpc server not be reused for the event stream? Otherwise the address and port of the SSE stream should be a flag / config

Copy link
Author

Choose a reason for hiding this comment

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

n.log.Warn("failed to marshal payload attributes", "err", err)
return err
}
n.log.Info("Publishing execution payload attributes on event stream", "attrs", builderAttrs, "json", string(jsonBytes))
Copy link
Collaborator

Choose a reason for hiding this comment

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

is "json", string(jsonBytes) left from debugging? logs would be quite verbose

Copy link
Author

Choose a reason for hiding this comment

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

func (eq *CLSync) PublishAttributes(ctx context.Context, l2head eth.L2BlockRef) error {
l1Origin, err := eq.l1OriginSelector.FindL1Origin(ctx, l2head)
if err != nil {
eq.log.Error("Error finding next L1 Origin", "err", err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

withParent := &derive.AttributesWithParent{
Attributes: attrs,
Parent: l2head,
IsLastInSpan: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is IsLastInSpan used for?

Copy link
Author

Choose a reason for hiding this comment

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

the derivation pipeline inserts blocks in batch which they call it a span. If it is the last block in span, it sets that to the safe head.

if attributes.IsLastInSpan {

Copy link
Author

Choose a reason for hiding this comment

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

since we are inserting unsafe payloads it should be set to false

transactions := make([]*types.Transaction, len(a.Attributes.Transactions))
for i, txBytes := range a.Attributes.Transactions {
var ttx types.Transaction
ttx.UnmarshalBinary(txBytes)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this can return an error, good to log something here at least

Copy link
Author

Choose a reason for hiding this comment

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

fixed to return error properly fd07061

ParentBeaconBlockRoot *common.Hash `json:"parentBeaconBlockRoot"`
Transactions types.Transactions `json:"transactions"`
GasLimit uint64 `json:"gasLimit"`
NoTxPool bool `json:"noTxPool,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is NoTxPool? its not set in ToBuilderPayloadAttributes()

Copy link
Author

Choose a reason for hiding this comment

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

it is used for a block that only contains deposit txs. it was my mistake to leave it unset

27754df

@jinmel jinmel requested review from dmarzzz and avalonche August 13, 2024 18:08
@jinmel jinmel merged commit a22b855 into fjord Aug 14, 2024
2 checks passed
avalonche pushed a commit that referenced this pull request Aug 27, 2024
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.

3 participants