Skip to content

Commit f0e4e4b

Browse files
committed
Changes after audit (GenesisCodec, forbid AddSubnetValidator)
1 parent 5f34c11 commit f0e4e4b

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

indexer/pchain/batch_indexer.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ func (xi *txBatchIndexer) addTx(container *indexer.Container, blockType database
141141
err = xi.updateExportTx(dbTx, unsignedTx)
142142
case *txs.AdvanceTimeTx:
143143
xi.updateAdvanceTimeTx(dbTx, unsignedTx)
144-
case *txs.AddSubnetValidatorTx:
145-
err = xi.updateGeneralBaseTx(dbTx, database.PChainAddSubnetValidatorTx, &unsignedTx.BaseTx)
146144
case *txs.CreateChainTx:
147145
err = xi.updateGeneralBaseTx(dbTx, database.PChainCreateChainTx, &unsignedTx.BaseTx)
148146
case *txs.CreateSubnetTx:
@@ -152,6 +150,7 @@ func (xi *txBatchIndexer) addTx(container *indexer.Container, blockType database
152150
case *txs.TransformSubnetTx:
153151
err = xi.updateGeneralBaseTx(dbTx, database.PChainTransformSubnetTx, &unsignedTx.BaseTx)
154152
// We leave out the following transaction types as they are rejected by Flare nodes
153+
// - AddSubnetValidatorTx
155154
// - AddPermissionlessValidatorTx
156155
// - AddPermissionlessDelegatorTx
157156
default:

utils/chain/p_chain_tx.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func ParsePChainBlock(blockBytes []byte) (blocks.Block, error) {
2727
}
2828
} else {
2929
// try to parse as as a "pre-fork" block
30-
innerBlk, err = blocks.Parse(blocks.Codec, blockBytes)
30+
innerBlk, err = blocks.Parse(blocks.GenesisCodec, blockBytes)
3131
if err != nil {
3232
return nil, errors.Wrap(err, "failed to parse block")
3333
}

0 commit comments

Comments
 (0)