VoteExtensionHandler
and PrepareProposalHandler
that we have just added to the codebase. These handlers are designed to mitigate front-running by ensuring that all validators have a consistent view of the mempool when preparing proposals.
In this demo, we are using a 3 validator network. The Beacon validator is special because it has a custom transaction provider enabled. This means that it can potentially manipulate the order of transactions in a proposal to its advantage (i.e., front-running).
- Bootstrap the validator network: This sets up a network with 3 validators. The script `./scripts/configure.sh is used to configure the network and the validators.
make build
in the tutorials/nameservice/base
directory.
- Have alice attempt to reserve
bob.cosmos
: This is a normal transaction that alice wants to execute. The script `./scripts/reserve.sh "bob.cosmos"
is used to send this transaction.
- Query to verify the name has been reserved: This is to check the result of the transaction. The script
./scripts/whois.sh "bob.cosmos"
is used to query the state of the blockchain.
ProcessProposal
stage. Open the logs for each validator, including the beacon, val1
, and val2
, to observe the following behavior. Open the log file of the validator node. The location of this file can vary depending on your setup, but it’s typically located in a directory like $HOME/cosmos/nodes/#{validator}/logs
. The directory in this case will be under the validator so, beacon
val1
or val2
. Run the following to tail the logs of the validator or beacon:
- List the Beacon’s keys: This is to verify the addresses of the validators. The script
./scripts/list-beacon-keys.sh
is used to list the keys.
VoteExtensionHandler
and PrepareProposalHandler
are working as expected and that they are able to prevent front-running.