Documentation
¶
Overview ¶
OFAC banned addresses
Request represents an incoming client request ¶
Whitelist for smart contract functions that never need protection.
Index ¶
- Variables
- func GetSenderFromRawTx(tx *ethtypes.Transaction) (string, error)
- func GetSenderFromTx(tx *ethtypes.Transaction) (string, error)
- func GetTx(rawTxHex string) (*ethtypes.Transaction, error)
- func GetTxStatus(txHash string) (*types.PrivateTxApiResponse, error)
- func IsBlacklisted(ip string) bool
- func Max(a uint64, b uint64) uint64
- func Min(a uint64, b uint64) uint64
- func ProxyRequest(proxyUrl string, body []byte) (*http.Response, error)
- func RedisKeyNonceFixForAccount(txFrom string) string
- func RedisKeySenderMaxNonce(txFrom string) string
- func RedisKeySenderOfTxHash(txHash string) string
- func RedisKeyTxHashForSenderAndNonce(txFrom string, nonce uint64) string
- func RedisKeyTxSentToRelay(txHash string) string
- type RedisState
- func (s *RedisState) DelNonceFixForAccount(txFrom string) error
- func (s *RedisState) GetNonceFixForAccount(txFrom string) (numTimesSent uint64, found bool, err error)
- func (s *RedisState) GetSenderMaxNonce(txFrom string) (senderMaxNonce uint64, found bool, err error)
- func (s *RedisState) GetSenderOfTxHash(txHash string) (txSender string, found bool, err error)
- func (s *RedisState) GetTxHashForSenderAndNonce(txFrom string, nonce uint64) (txHash string, found bool, err error)
- func (s *RedisState) GetTxSentToRelay(txHash string) (timeSent time.Time, found bool, err error)
- func (s *RedisState) SetNonceFixForAccount(txFrom string, numTimesSent uint64) error
- func (s *RedisState) SetSenderMaxNonce(txFrom string, nonce uint64) error
- func (s *RedisState) SetSenderOfTxHash(txHash string, txFrom string) error
- func (s *RedisState) SetTxHashForSenderAndNonce(txFrom string, nonce uint64, txHash string) error
- func (s *RedisState) SetTxSentToRelay(txHash string) error
- type RpcEndPointServer
- type RpcRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var DebugDontSendTx = os.Getenv("DEBUG_DONT_SEND_RAWTX") != ""
View Source
var FlashbotsRPC *flashbotsrpc.FlashbotsRPC
View Source
var Now = time.Now // used to mock time in tests
View Source
var ProtectTxApiHost = "https://protect.flashbots.net"
View Source
var RedisExpiryNonceFixForAccount = time.Duration(24 * time.Hour)
View Source
var RedisExpirySenderMaxNonce = time.Duration(2 * time.Hour)
View Source
var RedisExpirySenderOfTxHash = time.Duration(24 * time.Hour) // 1 day
View Source
var RedisExpiryTxHashForSenderAndNonce = time.Duration(24 * time.Hour) // 1 day
View Source
var RedisExpiryTxSentToRelay = time.Duration(24 * time.Hour) // 1 day
View Source
var RedisPrefix = "rpc-endpoint:"
View Source
var RedisPrefixNonceFixForAccount = RedisPrefix + "txsender-with-nonce-fix:"
nonce-fix of an account (with number of times sent)
View Source
var RedisPrefixSenderMaxNonce = RedisPrefix + "txsender-pending-max-nonce:"
Remember nonce of pending user tx
View Source
var RedisPrefixSenderOfTxHash = RedisPrefix + "txsender-of-txhash:"
Enable lookup of txFrom by txHash
View Source
var RedisPrefixTxHashForSenderAndNonce = RedisPrefix + "txsender-and-nonce-to-txhash:"
Enable lookup of txHash by txFrom+nonce (only if sent to relay)
View Source
var RedisPrefixTxSentToRelay = RedisPrefix + "tx-sent-to-relay:"
Enable lookup of timeSentToRelay by txHash
Functions ¶
func GetSenderFromRawTx ¶
func GetSenderFromRawTx(tx *ethtypes.Transaction) (string, error)
func GetSenderFromTx ¶
func GetSenderFromTx(tx *ethtypes.Transaction) (string, error)
func GetTxStatus ¶ added in v1.3.0
func GetTxStatus(txHash string) (*types.PrivateTxApiResponse, error)
func IsBlacklisted ¶
func RedisKeyNonceFixForAccount ¶ added in v1.4.2
func RedisKeySenderMaxNonce ¶ added in v1.4.2
func RedisKeySenderOfTxHash ¶ added in v1.4.2
func RedisKeyTxHashForSenderAndNonce ¶ added in v1.4.2
func RedisKeyTxSentToRelay ¶ added in v1.4.2
Types ¶
type RedisState ¶ added in v1.4.2
var RState *RedisState
Metamask fix helper
func NewRedisState ¶ added in v1.4.2
func NewRedisState(redisUrl string) (*RedisState, error)
func (*RedisState) DelNonceFixForAccount ¶ added in v1.4.2
func (s *RedisState) DelNonceFixForAccount(txFrom string) error
func (*RedisState) GetNonceFixForAccount ¶ added in v1.4.2
func (s *RedisState) GetNonceFixForAccount(txFrom string) (numTimesSent uint64, found bool, err error)
func (*RedisState) GetSenderMaxNonce ¶ added in v1.4.2
func (s *RedisState) GetSenderMaxNonce(txFrom string) (senderMaxNonce uint64, found bool, err error)
func (*RedisState) GetSenderOfTxHash ¶ added in v1.4.2
func (s *RedisState) GetSenderOfTxHash(txHash string) (txSender string, found bool, err error)
func (*RedisState) GetTxHashForSenderAndNonce ¶ added in v1.4.2
func (*RedisState) GetTxSentToRelay ¶ added in v1.4.2
func (*RedisState) SetNonceFixForAccount ¶ added in v1.4.2
func (s *RedisState) SetNonceFixForAccount(txFrom string, numTimesSent uint64) error
nonce-fix per account
func (*RedisState) SetSenderMaxNonce ¶ added in v1.4.2
func (s *RedisState) SetSenderMaxNonce(txFrom string, nonce uint64) error
func (*RedisState) SetSenderOfTxHash ¶ added in v1.4.2
func (s *RedisState) SetSenderOfTxHash(txHash string, txFrom string) error
Enable lookup of txFrom by txHash
func (*RedisState) SetTxHashForSenderAndNonce ¶ added in v1.4.2
func (s *RedisState) SetTxHashForSenderAndNonce(txFrom string, nonce uint64, txHash string) error
Enable lookup of txHash by txFrom+nonce
func (*RedisState) SetTxSentToRelay ¶ added in v1.4.2
func (s *RedisState) SetTxSentToRelay(txHash string) error
Enable lookup of timeSentToRelay by txHash
type RpcEndPointServer ¶
type RpcEndPointServer struct {
// contains filtered or unexported fields
}
func NewRpcEndPointServer ¶
func NewRpcEndPointServer(version string, listenAddress, proxyUrl, relayUrl string, relaySigningKey *ecdsa.PrivateKey, redisUrl string) (*RpcEndPointServer, error)
func (*RpcEndPointServer) HandleHttpRequest ¶
func (s *RpcEndPointServer) HandleHttpRequest(respw http.ResponseWriter, req *http.Request)
func (*RpcEndPointServer) Start ¶
func (s *RpcEndPointServer) Start()
type RpcRequest ¶
type RpcRequest struct {
// contains filtered or unexported fields
}
RPC request for a single client JSON-RPC request
func NewRpcRequest ¶
func NewRpcRequest(respw *http.ResponseWriter, req *http.Request, proxyUrl string, relaySigningKey *ecdsa.PrivateKey) *RpcRequest
func (*RpcRequest) GetAddressNonceRange ¶ added in v1.4.2
func (r *RpcRequest) GetAddressNonceRange(address string) (minNonce, maxNonce uint64)
Click to show internal directories.
Click to hide internal directories.