-
Notifications
You must be signed in to change notification settings - Fork 863
feat: Giga RPC node (sequential execution) #2708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2708 +/- ##
==========================================
- Coverage 57.00% 47.17% -9.84%
==========================================
Files 2004 1936 -68
Lines 164603 159019 -5584
==========================================
- Hits 93838 75015 -18823
- Misses 62560 77505 +14945
+ Partials 8205 6499 -1706
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
f8f0311 to
cf9251a
Compare
| } | ||
|
|
||
| func (app *App) ProcessTxsSynchronousGiga(ctx sdk.Context, txs [][]byte, typedTxs []sdk.Tx, absoluteTxIndices []int) []*abci.ExecTxResult { | ||
| defer metrics.BlockProcessLatency(time.Now(), metrics.SYNCHRONOUS) |
Check warning
Code scanning / CodeQL
Calling the system time Warning
cf9251a to
0124cc8
Compare
b8763f8 to
130c3e5
Compare
5547872 to
9ff6ef2
Compare
| } | ||
| continue | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would need to call ctx.GigaMultiStore().WriteGiga() here since giga cache isn't visible to v2 executor so need flushing
Fixed critical issues causing `LastResultsHash` mismatch between the
standard and giga executors, which was causing consensus failures when
running nodes with `GIGA_EXECUTOR` enabled.
The `LastResultsHash` is computed from only 4 deterministic fields of
each `ExecTxResult` (defined in `deterministicExecTxResult` in
`sei-tendermint/abci/types/types.go`):
- `Code`
- `Data`
- `GasWanted`
- `GasUsed`
The giga executor was producing different values for two of these
fields.
The giga executor was not setting `GasWanted` (defaulted to 0), while
the standard executor sets it to the transaction's gas limit.
```go
// Before: GasWanted not set (defaults to 0)
// After:
gasWanted := int64(ethTx.Gas())
```
The giga executor was putting raw receipt bytes in the `Data` field,
while the standard executor wraps `MsgEVMTransactionResponse` in
`TxMsgData`:
```go
// Before: Data = receiptBytes (raw marshaled receipt)
// After: Matches standard executor format
evmResponse := &evmtypes.MsgEVMTransactionResponse{
GasUsed: execResult.UsedGas,
VmError: vmError,
ReturnData: execResult.ReturnData,
Hash: ethTx.Hash().Hex(),
Logs: evmtypes.NewLogsFromEth(stateDB.GetAllLogs()),
}
txMsgData := &sdk.TxMsgData{Data: []*sdk.MsgData{{MsgType: msgTypeURL, Data: evmResponseBytes}}}
// Data = marshaled txMsgData
```
Added logging to aid future debugging of consensus issues:
| Level | Location | What's Logged |
|-------|----------|---------------|
| **Error** | `ValidateBlock` on mismatch | Expected vs got hash, block
height, numTxs, blockHash |
| **Info** | `ApplyBlock` after hash computation | Computed hash,
height, txCount |
| **Debug** | `ApplyBlock` per-tx | Code, GasWanted, GasUsed, dataLen
for each tx |
- `app/app.go` - Fixed giga executor `GasWanted` and `Data` field format
- `sei-tendermint/internal/state/execution.go` - Added LastResultsHash
debugging logs
Run a multi-node cluster with one node using `GIGA_EXECUTOR=true` and
verify blocks reach consensus without `LastResultsHash` mismatch errors.
- Set the txIndex correctly (ProcessBlock already does this) - Return ABCI codes
97ef955 to
0c84786
Compare
Describe your changes and provide context
This PR supports running a Giga node, in consensus with other non-Giga nodes. It only supports sequential execution for Giga, falling back to the v2 logic for cosmos and interop transactions.
TODO:
Testing performed to validate your change