-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from bnb-chain/dev
feat: prepare for initial release of sentry
- Loading branch information
Showing
15 changed files
with
432 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,62 @@ | ||
# BSC-MEV-Sentry | ||
|
||
BSC-MEV-Sentry is a proxy service within the BSC MEV architecture designed to shield the validator network. | ||
It functions to forward requests and pay to builders. | ||
BSC-MEV-Sentry serves as the proxy service for BSC MEV architecture, It has the following features: | ||
|
||
1. Forward RPC requests: mev_sendBid, mev_params, mev_running, mev_bestBidGasFee to validators. | ||
2. Forward RPC request: mev_reportIssue to builders. | ||
3. Pay builders on behalf of validators for their bids. | ||
4. Monitor validators' status and health. | ||
|
||
See also: https://github.com/bnb-chain/BEPs/pull/322 | ||
|
||
For the details of mev_params, here are some notices: | ||
|
||
1. The builder can call mev_params to obtain the delayLeftOver and bidSimulationLeftOver time settings, and then call | ||
the [BidBetterBefore](https://github.com/bnb-chain/bsc/blob/master/common/bidutil/bidutil.go) to calculate the | ||
deadline for sending the bid. | ||
2. The builder can call mev_params to obtain the gasCeil of the validator, to generate a valid header in the block | ||
building settlement. | ||
3. The builder can call mev_params to obtain the builderFeeCeil of the validator, to help to decide the builder fee. | ||
|
||
# Usage | ||
|
||
1. `make build` | ||
2. `.build/sentry -config ./configs/config.toml` | ||
|
||
Sentry settings are configured in the `config.toml` file. The following is an example of a `config.toml` file: | ||
|
||
``` | ||
[Service] | ||
HTTPListenAddr = "localhost:8555" # The address to listen on for HTTP requests. | ||
RPCConcurrency = 100 # The maximum number of concurrent requests. | ||
RPCTimeout = "10s" # The timeout for RPC requests. | ||
[[Validators]] # A list of validators to forward requests to. | ||
PrivateURL = "https://bsc-fuji" # The private rpc url of the validator, it can only been accessed in the local network. | ||
PublicHostName = "bsc-fuji" # The domain name of the validator, if a request's HOST info is same with this, it will be forwarded to the validator. | ||
PayAccountMode = "privateKey" # The unlock mode of the pay bid account. | ||
PrivateKey = "59ba8068eb256d520...2bd306e1bd603fdb8c8da10e8" # The private key of the pay bid account. | ||
[[Validators]] | ||
PrivateURL = "https://bsc-mathwallet" | ||
PublicHostName = "bsc-mathwallet" | ||
PayAccountMode = "keystore" | ||
KeystorePath = "./keystore" # The keystore file path of the pay bid account. | ||
PasswordFilePath = "./password.txt" # The path of the pay bid account's password file. | ||
PayAccountAddress = "0x12c86Bf9...845B98F23" # The address of the pay bid account. | ||
[[Validators]] | ||
PrivateURL = "https://bsc-trustwallet" | ||
PublicHostName = "bsc-trustwallet" | ||
PayAccountMode = "privateKey" # The unlock mode of the pay account. | ||
PrivateKey = "59ba8068eb...d306e1bd603fdb8c8da10e8" # The private key of the pay account. | ||
[[Builders]] | ||
Address = "0x45EbEBe8...664D59c12" # The address of the builder. | ||
URL = "http://bsc-builder-1" # The public URL of the builder. | ||
[[Builders]] | ||
Address = "0x980A75eC...fc9b863D5" | ||
URL = "http://bsc-builder-2" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
[Service] | ||
HTTPListenAddr = "localhost:3000" | ||
RPCConcurrency = 10 | ||
RPCTimeout = "10s" | ||
HTTPListenAddr = "localhost:8555" # The address to listen on for HTTP requests. | ||
RPCConcurrency = 100 # The maximum number of concurrent requests. | ||
RPCTimeout = "10s" # The timeout for RPC requests. | ||
|
||
[Account] | ||
Mode = "keystore" | ||
KeystorePath = "./keystore" | ||
Password = "sentry" | ||
Address = "0x837060bd423eFcDd5B7b6B92aB3CFc74B9CD0df4" | ||
[[Validators]] | ||
PrivateURL = "http://10.200.31.36:8545" | ||
PublicHostName = "bsc-testnet-elbrus.bnbchain.org" | ||
PayAccountMode = "privateKey" | ||
PrivateKey = "b1fed931ad50...34796ddbee68a53cf" | ||
|
||
[[Validators]] | ||
PrivateURL = "http://127.0.0.1:8546" | ||
PublicHostName = "127.0.0.1" | ||
PrivateURL = "http://10.200.33.92:8545" | ||
PublicHostName = "bsc-testnet-ararat.bnbchain.org" | ||
PayAccountMode = "privateKey" | ||
PrivateKey = "ce3f1b757384...755f66f647503" | ||
|
||
[[Builders]] | ||
Address = "0x837060bd423eFcDd5B7b6B92aB3CFc74B9CD0df4" | ||
URL = "http://localhost:8555" | ||
|
||
[FullNode] | ||
URL = "http://localhost:8545" | ||
Address = "0x980A75eCd1309eA12fa2ED87A8744fBfc9b863D5" # The address of the builder. | ||
URL = "http://bsc-builder-1" # The public URL of the builder. | ||
|
||
[Debug] | ||
ListenAddr = "localhost:8090" | ||
|
||
[Log] | ||
RootDir = "./logs" | ||
Level = "debug" | ||
[[Builders]] | ||
Address = "0x980A75eCd1309eA12fa2ED87A8744fBfc9b863D5" | ||
URL = "http://bsc-builder-2" |
Oops, something went wrong.