Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@btc-vision/plugin-sdk": "^1.0.1",
"@btc-vision/post-quantum": "^0.5.3",
"@btc-vision/rust-merkle-tree": "^1.0.2",
"@btc-vision/transaction": "^1.8.5",
"@btc-vision/transaction": "^1.8.6-beta.0",
"@btc-vision/uwebsockets.js": "^20.57.0",
"@chainsafe/libp2p-noise": "^17.0.0",
"@chainsafe/libp2p-quic": "^2.0.1",
Expand Down
15 changes: 3 additions & 12 deletions src/src/blockchain-indexer/processor/block/Block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,11 @@ import { TransactionData } from '@btc-vision/bitcoin-rpc';
import { DataConverter, DebugLevel, Logger } from '@btc-vision/bsi-common';
import { fromHex, Network, toHex } from '@btc-vision/bitcoin';
import { Config } from '../../../config/Config.js';
import {
BlockHeaderChecksumProof,
BlockHeaderDocument,
} from '../../../db/interfaces/IBlockHeaderBlockDocument.js';
import {
ITransactionDocumentBasic,
TransactionDocument,
} from '../../../db/interfaces/ITransactionDocument.js';
import { BlockHeaderChecksumProof, BlockHeaderDocument, } from '../../../db/interfaces/IBlockHeaderBlockDocument.js';
import { ITransactionDocumentBasic, TransactionDocument, } from '../../../db/interfaces/ITransactionDocument.js';
import { EvaluatedStates } from '../../../vm/evaluated/EvaluatedStates.js';
import { VMManager } from '../../../vm/VMManager.js';
import {
OPNetInteractionTypeValues,
OPNetTransactionTypes,
} from '../transaction/enums/OPNetTransactionTypes.js';
import { OPNetInteractionTypeValues, OPNetTransactionTypes, } from '../transaction/enums/OPNetTransactionTypes.js';
import { TransactionFactory } from '../transaction/transaction-factory/TransactionFactory.js';
import { TransactionSorter } from '../transaction/transaction-sorter/TransactionSorter.js';
import { Transaction } from '../transaction/Transaction.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
import { Transaction } from '../Transaction.js';
import { OPNetTransactionTypes } from '../enums/OPNetTransactionTypes.js';
import {
AccessListFeature,
EpochSubmissionFeature,
MLDSALinkRequest,
} from '../features/Features.js';
import { AccessListFeature, EpochSubmissionFeature, MLDSALinkRequest, } from '../features/Features.js';
import { OPNetHeader } from '../interfaces/OPNetHeader.js';
import {
alloc,
concat,
equals,
fromHex,
opcodes,
payments,
Script,
toHex,
} from '@btc-vision/bitcoin';
import { alloc, concat, equals, fromHex, opcodes, payments, Script, toHex, } from '@btc-vision/bitcoin';
import { OPNetConsensus } from '../../../../poc/configurations/OPNetConsensus.js';
import {
Address,
Expand Down Expand Up @@ -473,18 +460,22 @@ export abstract class SharedInteractionParameters<
const mldsaPublicKey = binaryReader.readBytes(32);
const salt = binaryReader.readBytes(32);
const bytesLeft = binaryReader.bytesLeft();
const maxLength: number = OPNetConsensus.consensus.EPOCH.GRAFFITI_LENGTH;

let graffiti: Uint8Array | undefined;
if (
this.blockHeight >=
OPNetConsensus.consensusEpochPatches.GRAFFITI_LENGTH_PATCH_BLOCK_HEIGHT
) {
const maxLength: number = OPNetConsensus.consensus.EPOCH.GRAFFITI_LENGTH - 4;
if (bytesLeft > 0 && bytesLeft <= maxLength) {
graffiti = binaryReader.readBytesWithLength(maxLength);
if (bytesLeft > 0) {
if (bytesLeft <= maxLength) {
graffiti = binaryReader.readBytes(bytesLeft);
} else {
throw new Error('OP_NET: Epoch submission graffiti too long.');
}
}
} else {
if (bytesLeft > 0 && bytesLeft <= OPNetConsensus.consensus.EPOCH.GRAFFITI_LENGTH) {
if (bytesLeft > 0 && bytesLeft <= maxLength) {
graffiti = binaryReader.readBytesWithLength(bytesLeft);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/src/poc/configurations/consensus/RoswellConsensus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const RoswellConsensus: IOPNetConsensus<Consensus.Roswell> = {
PATCH: {
[ChainIds.Bitcoin]: {
[BitcoinNetwork.mainnet]: {
GRAFFITI_LENGTH_PATCH_BLOCK_HEIGHT: 943417n,
GRAFFITI_LENGTH_PATCH_BLOCK_HEIGHT: 943417n, //943432n
},
[BitcoinNetwork.testnet]: {
GRAFFITI_LENGTH_PATCH_BLOCK_HEIGHT: 12583n,
Expand Down
Loading