Skip to content

Commit

Permalink
fix: tx receipt returns a reverted status instead of an "invalid chai…
Browse files Browse the repository at this point in the history
…n ID" error in the height where the chain ID was incorrect
  • Loading branch information
jasonsong0 committed Sep 2, 2024
1 parent 6d3c5c6 commit 945cf31
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion rpc/backend/tx_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,16 @@ func (b *Backend) GetTransactionReceipt(hash common.Hash) (map[string]interface{
return nil, err
}

from, err := ethMsg.GetSender(chainID.ToInt())
// NOTE
// This patch applies only to the period when the chain-id was set to 9000 between the v8 and v8.1.1 versions of Canto.
// It is intended to ensure that reverted transaction receipt returns the same results instead of 'invalid chain id' error.
// The upgrade height for v8 is 10848200, and for v8.1.1, it is 10849447.
var from common.Address
if res.Height >= 10848200 && res.Height < 10849447 {
from, err = ethMsg.GetSender(big.NewInt(9000)) // 9000 is the default chain-id that was applied during that period.
} else {
from, err = ethMsg.GetSender(chainID.ToInt())
}
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 945cf31

Please sign in to comment.