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

Initial implementation #1

Merged
merged 29 commits into from
Nov 2, 2024
Merged

Initial implementation #1

merged 29 commits into from
Nov 2, 2024

Conversation

fernandofcampos
Copy link
Collaborator

No description provided.

@fernandofcampos fernandofcampos force-pushed the fernando/initial-implementation branch 6 times, most recently from f2db6d5 to c19aa51 Compare September 24, 2024 11:59
@fernandofcampos fernandofcampos marked this pull request as ready for review September 24, 2024 11:59
@fernandofcampos fernandofcampos force-pushed the fernando/initial-implementation branch 3 times, most recently from 5555560 to 7f73a6c Compare September 25, 2024 00:10
Copy link

@xmariachi xmariachi left a comment

Choose a reason for hiding this comment

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

This review is half-baked, but got some comments already, so I'm pushing those so far.
I expect to re-review tomorrow after meeting with @fernandofcampos

- "emissions.v4.InsertReputerPayloadRequest"
```

You must use the fully qualified name of the protobuf type.

Choose a reason for hiding this comment

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

As we publish new versions, would it be good to be able to specify regexes here?
Eg to use any v of a particular type.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Regex is a great idea, but I think we should implement that in a new iteration.

ID: "0x" + hex.EncodeToString(hash[:]),
Type: msgType,
Name: name,
Timestamp: time.Now().UTC(),

Choose a reason for hiding this comment

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

shouldn't we use block timestamp instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ingestion timestamp is powerful to have for other reasons, lets say you're figuring out if a message was from a bootrapping or "catch up" process vs a realtime ingestion. I think block height would be a good additional field tho, perhaps part of a "context" KV pair and not directly in the domain event wrapper though

Copy link
Contributor

Choose a reason for hiding this comment

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

He actually does that L53 of this file

return fmt.Errorf("block is nil")
}

for i, tx := range block.Block.Data.Txs {

Choose a reason for hiding this comment

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

We could create wg to parallelise this.

And in case of error, send block id to an error topic.
This type of error handling, where errors are sent to error topics, can be used for later reprocessing and awareness of entities that contained failures.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had implemented this, but the processing time ended up being the same. I believe that because the processing is 100% local and lightweight, we won't benefit on processing txs in parallel. At least not while the number of transactions per block is in the order of hundreds. So I rolled it back for the sake of simplification.

Choose a reason for hiding this comment

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

Makes sense.
And also if we want to keep ordering on the write side, I take my previous comment back!

@fernandofcampos fernandofcampos force-pushed the fernando/initial-implementation branch 3 times, most recently from 3639be3 to d177cd8 Compare September 26, 2024 17:02
return err
}

record := &kgo.Record{

Choose a reason for hiding this comment

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

A note, we may need to set key and value both, if we want to use partitioning, and generate the key accordingly (TBD)

xmariachi
xmariachi previously approved these changes Sep 26, 2024
Copy link

@xmariachi xmariachi left a comment

Choose a reason for hiding this comment

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

Great work, nice architecture.
Left some comments to be addressed. More discussions to be held eventually, eg around Kafka production.

However, approving preemptively for an initial version.

kpeluso
kpeluso previously approved these changes Sep 28, 2024
@fernandofcampos fernandofcampos force-pushed the fernando/initial-implementation branch 2 times, most recently from 6e82b5c to cff5a33 Compare October 1, 2024 20:59
kpeluso
kpeluso previously approved these changes Oct 14, 2024
kpeluso
kpeluso previously approved these changes Oct 21, 2024
@fernandofcampos fernandofcampos force-pushed the fernando/initial-implementation branch 5 times, most recently from addd781 to 7fc1e62 Compare October 24, 2024 21:33
- Made changes to the configs for the new topics
- Made the new topics on confluent cloud

Pending review from @fernandofcampos that the config changes looks good.
- add missing staking topics
- divide staking topic into multiple topics (1 per event)
@kpeluso kpeluso merged commit a6e8171 into dev Nov 2, 2024
3 checks passed
@kpeluso kpeluso deleted the fernando/initial-implementation branch November 2, 2024 18:57
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.

5 participants