Skip to content
This repository was archived by the owner on Jul 31, 2024. It is now read-only.

add mevboostmetric - #23

Open
darkda567 wants to merge 2 commits into
dappnode:masterfrom
darkda567:daniel/add-mev-metric
Open

add mevboostmetric#23
darkda567 wants to merge 2 commits into
dappnode:masterfrom
darkda567:daniel/add-mev-metric

Conversation

@darkda567

Copy link
Copy Markdown

Added a new metric that indicates the mevboost value of each network.

Comment threadpackage.json Outdated

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.

this is unecessary, all the dependencies needed for "stakers-metrics" should be inside ./stakers-metrics" directory. There is already a package.json there, feel free to add whatever dependencies you need in that file

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done, package.json deleted

Comment threadpackage-lock.json Outdated

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.

this is unnecessary, this project is built with yarn instead of npm, and all dependencies should be installed inside their respective directories, not in the base directory.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done, paackge-lock.json deleted

Comment threadyarn.lock Outdated

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.

same as the other 2 related comments, there is already a yarn.lock file inside ./stakers-metrics dir

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done, yarn.lock deleted

Comment threadstakers-metrics/src/metrics.ts Outdated
}

async function collectMevBoostMetric(network: typeof networks[number]) {
console.log(`Collecting MEV Boost metric for network: ${network}`);

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 things:

  • we use logger instead of console for logging purposes in this project
  • there is no need to log anything while collecting the metric if there are no errors

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done, logs deleted

Comment threadstakers-metrics/src/metrics.ts Outdated
const envKey = `_DAPPNODE_GLOBAL_MEVBOOST_${network.toUpperCase()}`;

const mevBoostValue = process.env[envKey];
logger.info(`MEV Boost value for network ${network}: ${mevBoostValue}`);

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.

same as above

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done logs deleted

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@darkda567@Marketen