Skip to content

Commit 9c35255

Browse files
authored
refactor: css and theme updates (#20)
1 parent a7f4dba commit 9c35255

File tree

10 files changed

+545
-251
lines changed

10 files changed

+545
-251
lines changed

.prettierignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
.docusaurus/
12
.next
23
node_modules
34
*.min.js
4-
*.css
55
*.html
66
cache/
77
.cache

.prettierrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
jsxBracketSameLine: false,
88
jsxSingleQuote: false,
99
printWidth: 120,
10-
proseWrap: 'always',
10+
proseWrap: 'never',
1111
quoteProps: 'as-needed',
1212
semi: true,
1313
singleQuote: true,

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# [docs.openmev.org](https://docs.openmev.org)
2+
3+
## Overview
4+
5+
6+
## Development
7+
8+
9+
## License
10+
11+
Licensed under either of
12+
13+
* Apache License, Version 2.0
14+
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
15+
* MIT license
16+
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
17+
18+
at your option.
19+
20+
## Contribution
21+
22+
Unless you explicitly state otherwise, any contribution intentionally submitted
23+
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
24+
dual licensed as above, without any additional terms or conditions.

docs/guides/cheatsheet.md

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Flashbots Cheatsheet
2+
3+
> [source via docs.flashbots.net/flashbots-auction/overview](https://docs.flashbots.net/flashbots-auction/overview)
4+
5+
> Notes on the current state of flashbots docs with relevance to assumptions of bundle process.
6+
7+
## Anatomy of a bundle
8+
9+
```ts
10+
const blockNumber = await provider.getBlockNumber()
11+
const minTimestamp = (await provider.getBlock(blockNumber)).timestamp
12+
const maxTimestamp = minTimestamp + 120
13+
const signedBundle = flashbotsProvider.signBundle(
14+
[
15+
{
16+
signedTransaction: SIGNED_ORACLE_UPDATE_FROM_PENDING_POOL // serialized signed transaction hex
17+
},
18+
{
19+
signer: wallet, // ethers signer
20+
transaction: transaction // ethers populated transaction object
21+
}
22+
])
23+
const bundleReceipt = await flashbotsProvider.sendRawBundle(
24+
signedBundle, // bundle we signed above
25+
targetBlockNumber, // block number at which this bundle is valid
26+
{
27+
minTimestamp, // optional minimum timestamp at which this bundle is valid (inclusive)
28+
maxTimestamp, // optional maximum timestamp at which this bundle is valid (inclusive)
29+
revertingTxHashes: [tx1, tx2] // optional list of transaction hashes allowed to revert. Without specifying here, any revert invalidates the entire bundle.
30+
}
31+
)
32+
)
33+
```
34+
35+
## Miner reward through coinbase.transfer()
36+
37+
https://docs.flashbots.net/flashbots-auction/searchers/advanced/coinbase-payment
38+
39+
To include as last action of smart contract
40+
41+
```solidity
42+
block.coinbase.transfer(AMOUNT_TO_TRANSFER)
43+
44+
```
45+
46+
Edge case to deal with sending to a miner contract
47+
```solidity
48+
block.coinbase.call{value: _ethAmountToCoinbase}(new bytes(0));
49+
```
50+
subject to [reentrancy attacks](https://medium.com/coinmonks/protect-your-solidity-smart-contracts-from-reentrancy-attacks-9972c3af7c21)
51+
52+
## Bundle pricing
53+
54+
https://docs.flashbots.net/flashbots-auction/searchers/advanced/bundle-pricing
55+
56+
Conflicting bundles received by flashbots are ordered by the following formula:
57+
58+
![\bg_white \Large score=\frac{minerBribe + totalGasUsed * priorityFeePerGas - mempoolGasUsed * priorityFeePerGas}{totalGasUsed}](https://latex.codecogs.com/png.latex?\bg_white&space;\Large&space;score=\frac{minerBribe&space;+&space;totalGasUsed&space;*&space;priorityFeePerGas&space;-&space;mempoolGasUsed&space;*&space;priorityFeePerGas}{totalGasUsed})
59+
60+
## Eligibility
61+
62+
https://docs.flashbots.net/flashbots-auction/miners/mev-geth-spec/v04
63+
64+
Bundles must have a target `blockNumber` and a `priorityFeePerGas` >= 1 Gwei.
65+
66+
## Reverting txs
67+
https://docs.flashbots.net/flashbots-auction/miners/mev-geth-spec/v04
68+
69+
70+
"When constructing a block the node should reject any bundle or megabundle that has a reverting transaction unless its hash is included in the RevertingTxHashes list of the bundle"
71+
72+
## Debugging
73+
74+
https://docs-staging.flashbots.net/flashbots-auction/searchers/advanced/troubleshooting
75+
76+
1. Transaction failure (ANY within the bundle)
77+
2. Incentives (gas price/coinbase transfers) not high enough to offset value of block space
78+
79+
Simulate bundle:
80+
```ts
81+
const signedTransactions = await flashbotsProvider.signBundle(transactionBundle)
82+
const simulation = await flashbotsProvider.simulate(signedTransactions, targetBlockNumber, targetBlockNumber + 1)
83+
console.log(JSON.stringify(simulation, null, 2))
84+
```
85+
86+
3. Competitors paying more
87+
88+
Get conflicting bundles for a prior block:
89+
```ts
90+
const signedTransactions = await flashbotsProvider.signBundle(transactionBundle)
91+
console.log(await flashbotsProvider.getConflictingBundle(
92+
signedTransactions,
93+
13140328 // blockNumber
94+
))
95+
```
96+
97+
4. Bundle received too late to appear in target block
98+
99+
Get submission time data and compare to block time:
100+
```ts
101+
console.log(
102+
await flashbotsProvider.getBundleStats("0x123456789abcdef123456789abcdef123456789abcdef123456789abcdef1234", 13509887)
103+
)
104+
105+
```
106+

docs/introduction.md

+3-40
Original file line numberDiff line numberDiff line change
@@ -36,56 +36,19 @@ Example use cases include:
3636
3737
This ethos is at the heart of OpenMEV. Part of establishing credible neutrality is having a clear and comprehensive rule
3838
book that regulates off-chain behavior and activities. Our assumption concerning governance is that methods and
39-
processes that work in legacy markets may not be applicable in adversarial environments such as permissionless
40-
blockchains. With that understanding it is important not to rely solely on such systems and mechanics long term.
39+
processes that work in legacy markets may not be applicable in adversarial environments such as permissionless blockchains. With that understanding it is important not to rely solely on such systems and mechanics long term.
4140

4241
> Discuss this and more on our [discourse forums](https://forums.manifoldfinance.com)
4342
4443
:::info
4544
[MEV or Maximal Extractable Value](https://medium.com/-research/we-live-in-a-mempool-backrunning-the-mev-crisis-a4ea0b493b05)
4645
is the value of the ability to order transactions within a block or blocks.
4746

48-
- Tom Schmidt, Dragonfly Capital :::
47+
- Tom Schmidt, Dragonfly Capital
48+
:::
4949

5050
## Getting started
5151

5252
OpenMEV consists of several components. If you want to learn more about the way it works, go to our
5353
[technical overview](/technical-reference/intro). If you have an application or a service that needs a system to prevent
5454
MEV attacks, you can read our guides on how to integrate our SDK.
55-
56-
### Acknowledgements
57-
58-
> Not an exhaustive list
59-
60-
- Nikolai Mushegian
61-
- Florian (@floki)
62-
- BoringCrypto
63-
- Barry London
64-
- Banteg
65-
- BobTheBuilder
66-
- WeArethe0.3xpercent (group)
67-
- Robert Miller (@bertmiller)
68-
- Edgar Arout (@fxfactorial)
69-
- Alex Obadia
70-
- Nathan (@CodeForcer)
71-
- 0xMaki
72-
- Joseph Delong (@dangerousfood)
73-
- Alexey Akhunov (@AlexeyAkhunov)
74-
- Igor Barinov (@igorbarinov)
75-
- bokkypoobah (@bokkypoobah)
76-
- x48 (@x48-crypto)
77-
- Jonas Chevalier (@zimbatm)
78-
- BMG (@brianmcgee)
79-
- Aldo Borrero (@aldoborrero)
80-
- Sandy Bradley (@sandybradley)
81-
- Connor Gervin (@Connor-Gervin)
82-
- OhHeyMatty
83-
- Chad
84-
- Manifold Finance Telegram Chat (t.me/manifoldfinance)
85-
- Ramin (@chillichelli)
86-
- Caleb Sheridan (Eden Network)
87-
- ControlCplusControlV
88-
- I Am Software (@matthewlilley)
89-
- Antony Ducommun
90-
- Jörg Thalheim (@Mic92)
91-
- Tom Schmidt (dragonfly capital)

docusaurus.config.js

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// @ts-check
2+
// Note: type annotations allow type checking and IDEs autocompletion
3+
4+
const lightCodeTheme = require('prism-react-renderer/themes/github');
5+
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
6+
17
// With JSDoc @type annotations, IDEs can provide config autocompletion
28
/** @type {import('@docusaurus/types').DocusaurusConfig} */
39
module.exports = {
@@ -6,11 +12,19 @@ module.exports = {
612
url: 'https://docs.openmev.org',
713
baseUrl: '/',
814
favicon: '/img/favicon.ico',
15+
trailingSlash: false,
916
onBrokenLinks: 'throw',
1017
onBrokenMarkdownLinks: 'warn',
1118
organizationName: 'openmev',
1219
projectName: 'docs',
13-
20+
plugins: [
21+
[
22+
require.resolve('@cmfcmf/docusaurus-search-local'),
23+
{
24+
indexBlog: false,
25+
},
26+
],
27+
],
1428
presets: [
1529
[
1630
'@docusaurus/preset-classic',
@@ -33,6 +47,8 @@ module.exports = {
3347
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
3448
({
3549
prism: {
50+
theme: lightCodeTheme,
51+
darkTheme: darkCodeTheme,
3652
additionalLanguages: ['solidity'],
3753
},
3854
navbar: {
@@ -103,7 +119,7 @@ module.exports = {
103119
],
104120
},
105121
],
106-
copyright: `Copyright © 2021 CommodityStream llc. | All rights reserved.`,
122+
copyright: `Copyright © ${new Date().getFullYear()} Manifold Finance, Inc. | All rights reserved.`,
107123
},
108124
colorMode: {
109125
defaultMode: 'dark',

package.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "openmev-docs",
33
"description": "OpenMEV documentation website.",
4-
"version": "2.0.1",
4+
"version": "2.1.0",
55
"private": true,
66
"scripts": {
77
"docusaurus": "docusaurus",
@@ -16,6 +16,7 @@
1616
"typecheck": "tsc"
1717
},
1818
"dependencies": {
19+
"@cmfcmf/docusaurus-search-local": "^0.10.0",
1920
"@docusaurus/core": "2.0.0-beta.18",
2021
"@docusaurus/preset-classic": "2.0.0-beta.18",
2122
"@mdx-js/react": "^1.6.22",
@@ -37,9 +38,10 @@
3738
},
3839
"browserslist": {
3940
"production": [
40-
">0.5%",
41-
"not dead",
42-
"not op_mini all"
41+
">0.3%",
42+
"not IE > 0",
43+
"not op_mini all",
44+
"not dead"
4345
],
4446
"development": [
4547
"last 1 chrome version",

0 commit comments

Comments
 (0)