Skip to content

init live el reward calculation#34

Open
bhakiyakalimuthu wants to merge 10 commits into
developfrom
MEV-1526-live-el-reward-calculation
Open

init live el reward calculation#34
bhakiyakalimuthu wants to merge 10 commits into
developfrom
MEV-1526-live-el-reward-calculation

Conversation

@bhakiyakalimuthu
Copy link
Copy Markdown
Contributor

@bhakiyakalimuthu bhakiyakalimuthu commented Jun 30, 2025

📝 Summary

Perform El reward calculation in real time using bids provided by data endpoints

💡 Motivation and Context


Currently El reward calculations are performed based on received validator logs, instead El reward calcuation will be performed based on provided bids in live via data endpoints supported by other relays

✅ I have completed the following steps:

  • Run make lint
  • Run make test
  • Run go mod tidy
  • Added tests (if applicable)

Comment thread el_reward_engine.go Outdated
Comment thread el_reward_engine.go
@bhakiyakalimuthu bhakiyakalimuthu force-pushed the MEV-1526-live-el-reward-calculation branch from 4042f44 to 324a640 Compare July 14, 2025 17:04
Comment thread el_reward_engine.go
var matchedBids []DataHeader
var errBuf []string
for relayURL, bids := range groupedBids {
elInfo.Bids[relayURL] = bids
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we shouldn't need allbids only bids that match otherwise this data is going to be very large due to bloxroute not filtering completely

Comment thread el_reward_engine.go
}
sortable = append(sortable, sortableBid{bid, val})
}
if len(sortable) < 1 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

< 2 or < 1?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

or should it be the same size as matchedBids

Comment thread el_reward_engine.go
return sortable[i].Value.Cmp(sortable[j].Value) < 0
})

secondHighest := sortable[len(sortable)-1]
Copy link
Copy Markdown
Contributor

@colink14110476 colink14110476 Jul 15, 2025

Choose a reason for hiding this comment

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

Should we ignore it if secondHighest is from the bloxroute rproxy? But not ignore if its the main-relay.

Comment thread el_reward_engine.go
return elInfo
}

func feeFor(percent uint64, uplift float64) float64 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this for a specific account_id?

Comment thread service.go

func (s *Service) logRecord(record SlotStatsRecord, slotKey string, userAgent string) {
go func() {
for {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should wait > 5 slots before we do this

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.

2 participants