-
Notifications
You must be signed in to change notification settings - Fork 862
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 43.96% 43.96%
=======================================
Files 1978 1978
Lines 162479 162571 +92
=======================================
+ Hits 71439 71481 +42
- Misses 84544 84597 +53
+ Partials 6496 6493 -3
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
190fa2b to
b8763f8
Compare
b8763f8 to
130c3e5
Compare
# Fix: Giga Executor LastResultsHash Mismatch
## Summary
Fixed critical issues causing `LastResultsHash` mismatch between the
standard and giga executors, which was causing consensus failures when
running nodes with `GIGA_EXECUTOR` enabled.
## Root Cause
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.
## Fixes
### 1. Missing `GasWanted` field (`app/app.go`)
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())
```
### 2. Different `Data` field format (`app/app.go`)
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
```
## Logging Improvements (`sei-tendermint/internal/state/execution.go`)
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 |
## Files Changed
- `app/app.go` - Fixed giga executor `GasWanted` and `Data` field format
- `sei-tendermint/internal/state/execution.go` - Added LastResultsHash
debugging logs
## Testing
Run a multi-node cluster with one node using `GIGA_EXECUTOR=true` and
verify blocks reach consensus without `LastResultsHash` mismatch errors.
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