-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: cometbft rpc is more efficient to broadcast tx (#1651)
* Problem: cometbft rpc is more efficient to broadcast tx * Update CHANGELOG.md Signed-off-by: yihuang <huang@crypto.com> * Update testground/benchmark/benchmark/cosmostx.py Signed-off-by: yihuang <huang@crypto.com> * Update testground/benchmark/benchmark/cosmostx.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: yihuang <huang@crypto.com> * renmae --------- Signed-off-by: yihuang <huang@crypto.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
85ca58b
commit 3303077
Showing
8 changed files
with
139 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
from typing import Optional | ||
|
||
from cprotobuf import Field, ProtoEntity | ||
|
||
|
||
class ProtoAny(ProtoEntity): | ||
type_url = Field("string", 1) | ||
value = Field("bytes", 2) | ||
|
||
|
||
def build_any(type_url: str, msg: Optional[ProtoEntity] = None) -> ProtoAny: | ||
value = b"" | ||
if msg is not None: | ||
value = msg.SerializeToString() | ||
return ProtoAny(type_url=type_url, value=value) | ||
|
||
|
||
class TxBody(ProtoEntity): | ||
messages = Field(ProtoAny, 1, repeated=True) | ||
memo = Field("string", 2) | ||
timeout_height = Field("uint64", 3) | ||
extension_options = Field(ProtoAny, 1023, repeated=True) | ||
non_critical_extension_options = Field(ProtoAny, 2047, repeated=True) | ||
|
||
|
||
class CompactBitArray(ProtoEntity): | ||
extra_bits_stored = Field("uint32", 1) | ||
elems = Field("bytes", 2) | ||
|
||
|
||
class ModeInfoSingle(ProtoEntity): | ||
mode = Field("int32", 1) | ||
|
||
|
||
class ModeInfoMulti(ProtoEntity): | ||
bitarray = Field(CompactBitArray, 1) | ||
mode_infos = Field("ModeInfo", 2, repeated=True) | ||
|
||
|
||
class ModeInfo(ProtoEntity): | ||
single = Field(ModeInfoSingle, 1) | ||
multi = Field(ModeInfoMulti, 2) | ||
|
||
|
||
class SignerInfo(ProtoEntity): | ||
public_key = Field(ProtoAny, 1) | ||
mode_info = Field(ModeInfo, 2) | ||
sequence = Field("uint64", 3) | ||
|
||
|
||
class Coin(ProtoEntity): | ||
denom = Field("string", 1) | ||
amount = Field("string", 2) | ||
|
||
|
||
class Fee(ProtoEntity): | ||
amount = Field(Coin, 1, repeated=True) | ||
gas_limit = Field("uint64", 2) | ||
payer = Field("string", 3) | ||
granter = Field("string", 4) | ||
|
||
|
||
class Tip(ProtoEntity): | ||
amount = Field(Coin, 1, repeated=True) | ||
tipper = Field("string", 2) | ||
|
||
|
||
class AuthInfo(ProtoEntity): | ||
signer_infos = Field(SignerInfo, 1, repeated=True) | ||
fee = Field(Fee, 2) | ||
tip = Field(Tip, 3) | ||
|
||
|
||
class TxRaw(ProtoEntity): | ||
body = Field("bytes", 1) | ||
auth_info = Field("bytes", 2) | ||
signatures = Field("bytes", 3, repeated=True) | ||
|
||
|
||
class MsgEthereumTx(ProtoEntity): | ||
from_ = Field("bytes", 5) | ||
raw = Field("bytes", 6) |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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